flink sql多层view嵌套,字段not found

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

flink sql多层view嵌套,字段not found

Lin Hou
Hi,

请教一个通过sql-client提交flink sql遇到的关于嵌套view,当嵌套第二层时,查询时会报找不到字段的问题。
元数据已经建好,简述如下:

1.建嵌套的view:

create temporary view temp_app_impression_5min as
select
  argService  as arg_service,
  timeLocal  as time_local,
  mid  as mid,
  vipruid  as vipruid,
  activity  as activity,
  LOWER(activityProperty)  as activity_property
from
  vipdwd.clean;

create temporary view v1_1 as
select
  get_json_object(activity_property, '$.page') as impression_page,
  SPLIT_INDEX(good, '_', 0) as sales_no,
  good,
  imp.*
from
  temp_app_impression_5min as imp, lateral table (
    string_split(
      COALESCE(
        get_json_object(activity_property, '$.goodslist'),
        ''
      ),
      ','
    )
  ) as T(good)
where
  activity = 'active';

2. 描述view:

两个view建好没有问题,
同时 desc v1_1 如下:

Flink SQL> desc v1_1;root
 |-- impression_page: STRING
 |-- sales_no: VARCHAR(2000)
 |-- good: STRING
 |-- arg_service: STRING
 |-- time_local: BIGINT
 |-- mid: STRING
 |-- vipruid: BIGINT
 |-- activity: STRING
 |-- activity_property: STRING

可见字段activity_property存在于v1_1中,

3.执行:

但是当执行:
select
  *
from
  v1_1;

出错:[ERROR] Could not execute SQL statement. Reason:

org.apache.calcite.sql.validate.SqlValidatorException: Column
'activity_property' not found in any table

一层view的时候查询没有问题,当嵌套view的时候就会报这个错,哪怕生成这个view的时候指定这个字段都不行:

create temporary view v1_1 as
select
  get_json_object(activity_property, '$.page') as impression_page,
  SPLIT_INDEX(good, '_', 0) as sales_no,
  good,
  imp.*,

  activity_property

from
  temp_app_impression_5min as imp, lateral table (
    string_split(
      COALESCE(
        get_json_object(activity_property, '$.goodslist'),
        ''
      ),
      ','
    )
  ) as T(good)
where
  activity = 'active';


请问有解决办法么,或者是我们用的方式不对。


完整调用栈日志:

org.apache.flink.table.client.gateway.SqlExecutionException:
Invalidate SQL statement.
        at org.apache.flink.table.client.cli.SqlCommandParser.parseBySqlParser(SqlCommandParser.java:99)
~[flink-sql-client_2.11-1.11-SNAPSHOT.jar:1.11-SNAPSHOT]
        at org.apache.flink.table.client.cli.SqlCommandParser.parse(SqlCommandParser.java:90)
~[flink-sql-client_2.11-1.11-SNAPSHOT.jar:1.11-SNAPSHOT]
        at org.apache.flink.table.client.cli.CliClient.parseCommand(CliClient.java:257)
[flink-sql-client_2.11-1.11-SNAPSHOT.jar:1.11-SNAPSHOT]
        at org.apache.flink.table.client.cli.CliClient.open(CliClient.java:211)
[flink-sql-client_2.11-1.11-SNAPSHOT.jar:1.11-SNAPSHOT]
        at org.apache.flink.table.client.SqlClient.openCli(SqlClient.java:142)
[flink-sql-client_2.11-1.11-SNAPSHOT.jar:1.11-SNAPSHOT]
        at org.apache.flink.table.client.SqlClient.start(SqlClient.java:114)
[flink-sql-client_2.11-1.11-SNAPSHOT.jar:1.11-SNAPSHOT]
        at org.apache.flink.table.client.SqlClient.main(SqlClient.java:201)
[flink-sql-client_2.11-1.11-SNAPSHOT.jar:1.11-SNAPSHOT]
Caused by: org.apache.flink.table.api.ValidationException: SQL
validation failed. From line 3, column 84 to line 3, column 102:
Column 'activity_property' not found in any table
        at org.apache.flink.table.planner.calcite.FlinkPlannerImpl.org$apache$flink$table$planner$calcite$FlinkPlannerImpl$$validate(FlinkPlannerImpl.scala:146)
~[flink-table-blink_2.11-1.11-SNAPSHOT.jar:1.11-SNAPSHOT]
        at org.apache.flink.table.planner.calcite.FlinkPlannerImpl$ToRelContextImpl.expandView(FlinkPlannerImpl.scala:204)
~[flink-table-blink_2.11-1.11-SNAPSHOT.jar:1.11-SNAPSHOT]
        at org.apache.calcite.plan.ViewExpanders$1.expandView(ViewExpanders.java:52)
~[flink-table_2.11-1.11-SNAPSHOT.jar:1.11-SNAPSHOT]
        at org.apache.flink.table.planner.catalog.SqlCatalogViewTable.convertToRel(SqlCatalogViewTable.java:58)
~[flink-table-blink_2.11-1.11-SNAPSHOT.jar:1.11-SNAPSHOT]
        at org.apache.flink.table.planner.plan.schema.ExpandingPreparingTable.expand(ExpandingPreparingTable.java:59)
~[flink-table-blink_2.11-1.11-SNAPSHOT.jar:1.11-SNAPSHOT]
        at org.apache.flink.table.planner.plan.schema.ExpandingPreparingTable.toRel(ExpandingPreparingTable.java:55)
~[flink-table-blink_2.11-1.11-SNAPSHOT.jar:1.11-SNAPSHOT]
        at org.apache.calcite.sql2rel.SqlToRelConverter.toRel(SqlToRelConverter.java:3492)
~[flink-table_2.11-1.11-SNAPSHOT.jar:1.11-SNAPSHOT]
        at org.apache.calcite.sql2rel.SqlToRelConverter.convertIdentifier(SqlToRelConverter.java:2415)
~[flink-table_2.11-1.11-SNAPSHOT.jar:1.11-SNAPSHOT]
        at org.apache.calcite.sql2rel.SqlToRelConverter.convertFrom(SqlToRelConverter.java:2102)
~[flink-table_2.11-1.11-SNAPSHOT.jar:1.11-SNAPSHOT]
        at org.apache.calcite.sql2rel.SqlToRelConverter.convertFrom(SqlToRelConverter.java:2051)
~[flink-table_2.11-1.11-SNAPSHOT.jar:1.11-SNAPSHOT]
        at org.apache.calcite.sql2rel.SqlToRelConverter.convertSelectImpl(SqlToRelConverter.java:661)
~[flink-table_2.11-1.11-SNAPSHOT.jar:1.11-SNAPSHOT]
        at org.apache.calcite.sql2rel.SqlToRelConverter.convertSelect(SqlToRelConverter.java:642)
~[flink-table_2.11-1.11-SNAPSHOT.jar:1.11-SNAPSHOT]
        at org.apache.calcite.sql2rel.SqlToRelConverter.convertQueryRecursive(SqlToRelConverter.java:3345)
~[flink-table_2.11-1.11-SNAPSHOT.jar:1.11-SNAPSHOT]
        at org.apache.calcite.sql2rel.SqlToRelConverter.convertQuery(SqlToRelConverter.java:568)
~[flink-table_2.11-1.11-SNAPSHOT.jar:1.11-SNAPSHOT]
        at org.apache.flink.table.planner.calcite.FlinkPlannerImpl.org$apache$flink$table$planner$calcite$FlinkPlannerImpl$$rel(FlinkPlannerImpl.scala:164)
~[flink-table-blink_2.11-1.11-SNAPSHOT.jar:1.11-SNAPSHOT]
        at org.apache.flink.table.planner.calcite.FlinkPlannerImpl.rel(FlinkPlannerImpl.scala:151)
~[flink-table-blink_2.11-1.11-SNAPSHOT.jar:1.11-SNAPSHOT]
        at org.apache.flink.table.planner.operations.SqlToOperationConverter.toQueryOperation(SqlToOperationConverter.java:774)
~[flink-table-blink_2.11-1.11-SNAPSHOT.jar:1.11-SNAPSHOT]
        at org.apache.flink.table.planner.operations.SqlToOperationConverter.convertSqlQuery(SqlToOperationConverter.java:746)
~[flink-table-blink_2.11-1.11-SNAPSHOT.jar:1.11-SNAPSHOT]
        at org.apache.flink.table.planner.operations.SqlToOperationConverter.convert(SqlToOperationConverter.java:236)
~[flink-table-blink_2.11-1.11-SNAPSHOT.jar:1.11-SNAPSHOT]
        at org.apache.flink.table.planner.delegation.ParserImpl.parse(ParserImpl.java:78)
~[flink-table-blink_2.11-1.11-SNAPSHOT.jar:1.11-SNAPSHOT]
        at org.apache.flink.table.client.gateway.local.LocalExecutor$1.lambda$parse$0(LocalExecutor.java:430)
~[flink-sql-client_2.11-1.11-SNAPSHOT.jar:1.11-SNAPSHOT]
        at org.apache.flink.table.client.gateway.local.ExecutionContext.wrapClassLoader(ExecutionContext.java:255)
~[flink-sql-client_2.11-1.11-SNAPSHOT.jar:1.11-SNAPSHOT]
        at org.apache.flink.table.client.gateway.local.LocalExecutor$1.parse(LocalExecutor.java:430)
~[flink-sql-client_2.11-1.11-SNAPSHOT.jar:1.11-SNAPSHOT]
        at org.apache.flink.table.client.cli.SqlCommandParser.parseBySqlParser(SqlCommandParser.java:97)
~[flink-sql-client_2.11-1.11-SNAPSHOT.jar:1.11-SNAPSHOT]
        ... 6 more
Caused by: org.apache.calcite.runtime.CalciteContextException: From
line 3, column 84 to line 3, column 102: Column 'activity_property'
not found in any table
        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native
Method) ~[?:1.8.0_262]
        at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
~[?:1.8.0_262]
        at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
~[?:1.8.0_262]
        at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
~[?:1.8.0_262]
        at org.apache.calcite.runtime.Resources$ExInstWithCause.ex(Resources.java:457)
~[flink-table_2.11-1.11-SNAPSHOT.jar:1.11-SNAPSHOT]
        at org.apache.calcite.sql.SqlUtil.newContextException(SqlUtil.java:839)
~[flink-table_2.11-1.11-SNAPSHOT.jar:1.11-SNAPSHOT]
        at org.apache.calcite.sql.SqlUtil.newContextException(SqlUtil.java:824)
~[flink-table_2.11-1.11-SNAPSHOT.jar:1.11-SNAPSHOT]
        at org.apache.calcite.sql.validate.SqlValidatorImpl.newValidationError(SqlValidatorImpl.java:5089)
~[flink-table_2.11-1.11-SNAPSHOT.jar:1.11-SNAPSHOT]
        at org.apache.calcite.sql.validate.DelegatingScope.fullyQualify(DelegatingScope.java:259)
~[flink-table_2.11-1.11-SNAPSHOT.jar:1.11-SNAPSHOT]
        at org.apache.calcite.sql.validate.SqlValidatorImpl$DeriveTypeVisitor.visit(SqlValidatorImpl.java:5882)
~[flink-table_2.11-1.11-SNAPSHOT.jar:1.11-SNAPSHOT]
        at org.apache.calcite.sql.validate.SqlValidatorImpl$DeriveTypeVisitor.visit(SqlValidatorImpl.java:5845)
~[flink-table_2.11-1.11-SNAPSHOT.jar:1.11-SNAPSHOT]
        at org.apache.calcite.sql.SqlIdentifier.accept(SqlIdentifier.java:321)
~[flink-table_2.11-1.11-SNAPSHOT.jar:1.11-SNAPSHOT]
        at org.apache.calcite.sql.validate.SqlValidatorImpl.deriveTypeImpl(SqlValidatorImpl.java:1800)
~[flink-table_2.11-1.11-SNAPSHOT.jar:1.11-SNAPSHOT]
        at org.apache.calcite.sql.validate.SqlValidatorImpl.deriveType(SqlValidatorImpl.java:1785)
~[flink-table_2.11-1.11-SNAPSHOT.jar:1.11-SNAPSHOT]
        at org.apache.calcite.sql.SqlCallBinding.getOperandType(SqlCallBinding.java:237)
~[flink-table_2.11-1.11-SNAPSHOT.jar:1.11-SNAPSHOT]
        at org.apache.flink.table.planner.functions.utils.UserDefinedFunctionUtils$$anonfun$12.apply(UserDefinedFunctionUtils.scala:788)
~[flink-table-blink_2.11-1.11-SNAPSHOT.jar:1.11-SNAPSHOT]
        at org.apache.flink.table.planner.functions.utils.UserDefinedFunctionUtils$$anonfun$12.apply(UserDefinedFunctionUtils.scala:787)
~[flink-table-blink_2.11-1.11-SNAPSHOT.jar:1.11-SNAPSHOT]
        at scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:234)
~[flink-dist_2.11-1.11-SNAPSHOT.jar:1.11-SNAPSHOT]
        at scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:234)
~[flink-dist_2.11-1.11-SNAPSHOT.jar:1.11-SNAPSHOT]
        at scala.collection.immutable.Range.foreach(Range.scala:160)
~[flink-dist_2.11-1.11-SNAPSHOT.jar:1.11-SNAPSHOT]
        at scala.collection.TraversableLike$class.map(TraversableLike.scala:234)
~[flink-dist_2.11-1.11-SNAPSHOT.jar:1.11-SNAPSHOT]
        at scala.collection.AbstractTraversable.map(Traversable.scala:104)
~[flink-dist_2.11-1.11-SNAPSHOT.jar:1.11-SNAPSHOT]
        at org.apache.flink.table.planner.functions.utils.UserDefinedFunctionUtils$.getOperandType(UserDefinedFunctionUtils.scala:787)
~[flink-table-blink_2.11-1.11-SNAPSHOT.jar:1.11-SNAPSHOT]
        at org.apache.flink.table.planner.functions.utils.ScalarSqlFunction$.inferOperandTypes(ScalarSqlFunction.scala:116)
~[flink-table-blink_2.11-1.11-SNAPSHOT.jar:1.11-SNAPSHOT]
        at org.apache.flink.table.planner.functions.utils.ScalarSqlFunction$$anon$2.inferOperandTypes(ScalarSqlFunction.scala:103)
~[flink-table-blink_2.11-1.11-SNAPSHOT.jar:1.11-SNAPSHOT]
        at org.apache.calcite.sql.validate.SqlValidatorImpl.inferUnknownTypes(SqlValidatorImpl.java:1980)
~[flink-table_2.11-1.11-SNAPSHOT.jar:1.11-SNAPSHOT]
        at org.apache.calcite.sql.validate.SqlValidatorImpl.inferUnknownTypes(SqlValidatorImpl.java:1988)
~[flink-table_2.11-1.11-SNAPSHOT.jar:1.11-SNAPSHOT]
        at org.apache.calcite.sql.validate.SqlValidatorImpl.inferUnknownTypes(SqlValidatorImpl.java:1951)
~[flink-table_2.11-1.11-SNAPSHOT.jar:1.11-SNAPSHOT]
        at org.apache.calcite.sql.validate.SqlValidatorImpl.inferUnknownTypes(SqlValidatorImpl.java:1988)
~[flink-table_2.11-1.11-SNAPSHOT.jar:1.11-SNAPSHOT]
        at org.apache.calcite.sql.validate.ProcedureNamespace.validateImpl(ProcedureNamespace.java:56)
~[flink-table_2.11-1.11-SNAPSHOT.jar:1.11-SNAPSHOT]
        at org.apache.calcite.sql.validate.AbstractNamespace.validate(AbstractNamespace.java:84)
~[flink-table_2.11-1.11-SNAPSHOT.jar:1.11-SNAPSHOT]
        at org.apache.calcite.sql.validate.SqlValidatorImpl.validateNamespace(SqlValidatorImpl.java:1110)
~[flink-table_2.11-1.11-SNAPSHOT.jar:1.11-SNAPSHOT]
        at org.apache.calcite.sql.validate.SqlValidatorImpl.validateQuery(SqlValidatorImpl.java:1084)
~[flink-table_2.11-1.11-SNAPSHOT.jar:1.11-SNAPSHOT]
        at org.apache.calcite.sql.validate.SqlValidatorImpl.validateFrom(SqlValidatorImpl.java:3256)
~[flink-table_2.11-1.11-SNAPSHOT.jar:1.11-SNAPSHOT]
        at org.apache.calcite.sql.validate.SqlValidatorImpl.validateFrom(SqlValidatorImpl.java:3238)
~[flink-table_2.11-1.11-SNAPSHOT.jar:1.11-SNAPSHOT]
        at org.apache.calcite.sql.validate.SqlValidatorImpl.validateJoin(SqlValidatorImpl.java:3303)
~[flink-table_2.11-1.11-SNAPSHOT.jar:1.11-SNAPSHOT]
        at org.apache.flink.table.planner.calcite.FlinkCalciteSqlValidator.validateJoin(FlinkCalciteSqlValidator.java:86)
~[flink-table-blink_2.11-1.11-SNAPSHOT.jar:1.11-SNAPSHOT]
        at org.apache.calcite.sql.validate.SqlValidatorImpl.validateFrom(SqlValidatorImpl.java:3247)
~[flink-table_2.11-1.11-SNAPSHOT.jar:1.11-SNAPSHOT]
        at org.apache.calcite.sql.validate.SqlValidatorImpl.validateSelect(SqlValidatorImpl.java:3510)
~[flink-table_2.11-1.11-SNAPSHOT.jar:1.11-SNAPSHOT]
        at org.apache.calcite.sql.validate.SelectNamespace.validateImpl(SelectNamespace.java:60)
~[flink-table_2.11-1.11-SNAPSHOT.jar:1.11-SNAPSHOT]
        at org.apache.calcite.sql.validate.AbstractNamespace.validate(AbstractNamespace.java:84)
~[flink-table_2.11-1.11-SNAPSHOT.jar:1.11-SNAPSHOT]
        at org.apache.calcite.sql.validate.SqlValidatorImpl.validateNamespace(SqlValidatorImpl.java:1110)
~[flink-table_2.11-1.11-SNAPSHOT.jar:1.11-SNAPSHOT]
        at org.apache.calcite.sql.validate.SqlValidatorImpl.validateQuery(SqlValidatorImpl.java:1084)
~[flink-table_2.11-1.11-SNAPSHOT.jar:1.11-SNAPSHOT]
        at org.apache.calcite.sql.SqlSelect.validate(SqlSelect.java:232)
~[flink-table_2.11-1.11-SNAPSHOT.jar:1.11-SNAPSHOT]
        at org.apache.calcite.sql.validate.SqlValidatorImpl.validateScopedExpression(SqlValidatorImpl.java:1059)
~[flink-table_2.11-1.11-SNAPSHOT.jar:1.11-SNAPSHOT]
        at org.apache.calcite.sql.validate.SqlValidatorImpl.validate(SqlValidatorImpl.java:766)
~[flink-table_2.11-1.11-SNAPSHOT.jar:1.11-SNAPSHOT]
        at org.apache.flink.table.planner.calcite.FlinkPlannerImpl.org$apache$flink$table$planner$calcite$FlinkPlannerImpl$$validate(FlinkPlannerImpl.scala:141)
~[flink-table-blink_2.11-1.11-SNAPSHOT.jar:1.11-SNAPSHOT]
        at org.apache.flink.table.planner.calcite.FlinkPlannerImpl$ToRelContextImpl.expandView(FlinkPlannerImpl.scala:204)
~[flink-table-blink_2.11-1.11-SNAPSHOT.jar:1.11-SNAPSHOT]
        at org.apache.calcite.plan.ViewExpanders$1.expandView(ViewExpanders.java:52)
~[flink-table_2.11-1.11-SNAPSHOT.jar:1.11-SNAPSHOT]
        at org.apache.flink.table.planner.catalog.SqlCatalogViewTable.convertToRel(SqlCatalogViewTable.java:58)
~[flink-table-blink_2.11-1.11-SNAPSHOT.jar:1.11-SNAPSHOT]
        at org.apache.flink.table.planner.plan.schema.ExpandingPreparingTable.expand(ExpandingPreparingTable.java:59)
~[flink-table-blink_2.11-1.11-SNAPSHOT.jar:1.11-SNAPSHOT]
        at org.apache.flink.table.planner.plan.schema.ExpandingPreparingTable.toRel(ExpandingPreparingTable.java:55)
~[flink-table-blink_2.11-1.11-SNAPSHOT.jar:1.11-SNAPSHOT]
        at org.apache.calcite.sql2rel.SqlToRelConverter.toRel(SqlToRelConverter.java:3492)
~[flink-table_2.11-1.11-SNAPSHOT.jar:1.11-SNAPSHOT]
        at org.apache.calcite.sql2rel.SqlToRelConverter.convertIdentifier(SqlToRelConverter.java:2415)
~[flink-table_2.11-1.11-SNAPSHOT.jar:1.11-SNAPSHOT]
        at org.apache.calcite.sql2rel.SqlToRelConverter.convertFrom(SqlToRelConverter.java:2102)
~[flink-table_2.11-1.11-SNAPSHOT.jar:1.11-SNAPSHOT]
        at org.apache.calcite.sql2rel.SqlToRelConverter.convertFrom(SqlToRelConverter.java:2051)
~[flink-table_2.11-1.11-SNAPSHOT.jar:1.11-SNAPSHOT]
        at org.apache.calcite.sql2rel.SqlToRelConverter.convertSelectImpl(SqlToRelConverter.java:661)
~[flink-table_2.11-1.11-SNAPSHOT.jar:1.11-SNAPSHOT]
        at org.apache.calcite.sql2rel.SqlToRelConverter.convertSelect(SqlToRelConverter.java:642)
~[flink-table_2.11-1.11-SNAPSHOT.jar:1.11-SNAPSHOT]
        at org.apache.calcite.sql2rel.SqlToRelConverter.convertQueryRecursive(SqlToRelConverter.java:3345)
~[flink-table_2.11-1.11-SNAPSHOT.jar:1.11-SNAPSHOT]
        at org.apache.calcite.sql2rel.SqlToRelConverter.convertQuery(SqlToRelConverter.java:568)
~[flink-table_2.11-1.11-SNAPSHOT.jar:1.11-SNAPSHOT]
        at org.apache.flink.table.planner.calcite.FlinkPlannerImpl.org$apache$flink$table$planner$calcite$FlinkPlannerImpl$$rel(FlinkPlannerImpl.scala:164)
~[flink-table-blink_2.11-1.11-SNAPSHOT.jar:1.11-SNAPSHOT]
        at org.apache.flink.table.planner.calcite.FlinkPlannerImpl.rel(FlinkPlannerImpl.scala:151)
~[flink-table-blink_2.11-1.11-SNAPSHOT.jar:1.11-SNAPSHOT]
        at org.apache.flink.table.planner.operations.SqlToOperationConverter.toQueryOperation(SqlToOperationConverter.java:774)
~[flink-table-blink_2.11-1.11-SNAPSHOT.jar:1.11-SNAPSHOT]
        at org.apache.flink.table.planner.operations.SqlToOperationConverter.convertSqlQuery(SqlToOperationConverter.java:746)
~[flink-table-blink_2.11-1.11-SNAPSHOT.jar:1.11-SNAPSHOT]
        at org.apache.flink.table.planner.operations.SqlToOperationConverter.convert(SqlToOperationConverter.java:236)
~[flink-table-blink_2.11-1.11-SNAPSHOT.jar:1.11-SNAPSHOT]
        at org.apache.flink.table.planner.delegation.ParserImpl.parse(ParserImpl.java:78)
~[flink-table-blink_2.11-1.11-SNAPSHOT.jar:1.11-SNAPSHOT]
        at org.apache.flink.table.client.gateway.local.LocalExecutor$1.lambda$parse$0(LocalExecutor.java:430)
~[flink-sql-client_2.11-1.11-SNAPSHOT.jar:1.11-SNAPSHOT]
        at org.apache.flink.table.client.gateway.local.ExecutionContext.wrapClassLoader(ExecutionContext.java:255)
~[flink-sql-client_2.11-1.11-SNAPSHOT.jar:1.11-SNAPSHOT]
        at org.apache.flink.table.client.gateway.local.LocalExecutor$1.parse(LocalExecutor.java:430)
~[flink-sql-client_2.11-1.11-SNAPSHOT.jar:1.11-SNAPSHOT]
        at org.apache.flink.table.client.cli.SqlCommandParser.parseBySqlParser(SqlCommandParser.java:97)
~[flink-sql-client_2.11-1.11-SNAPSHOT.jar:1.11-SNAPSHOT]
        ... 6 more
Caused by: org.apache.calcite.sql.validate.SqlValidatorException:
Column 'activity_property' not found in any table
        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native
Method) ~[?:1.8.0_262]
        at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
~[?:1.8.0_262]
        at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
~[?:1.8.0_262]
        at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
~[?:1.8.0_262]
        at org.apache.calcite.runtime.Resources$ExInstWithCause.ex(Resources.java:457)
~[flink-table_2.11-1.11-SNAPSHOT.jar:1.11-SNAPSHOT]
        at org.apache.calcite.runtime.Resources$ExInst.ex(Resources.java:550)
~[flink-table_2.11-1.11-SNAPSHOT.jar:1.11-SNAPSHOT]
        at org.apache.calcite.sql.SqlUtil.newContextException(SqlUtil.java:839)
~[flink-table_2.11-1.11-SNAPSHOT.jar:1.11-SNAPSHOT]
        at org.apache.calcite.sql.SqlUtil.newContextException(SqlUtil.java:824)
~[flink-table_2.11-1.11-SNAPSHOT.jar:1.11-SNAPSHOT]
        at org.apache.calcite.sql.validate.SqlValidatorImpl.newValidationError(SqlValidatorImpl.java:5089)
~[flink-table_2.11-1.11-SNAPSHOT.jar:1.11-SNAPSHOT]
        at org.apache.calcite.sql.validate.DelegatingScope.fullyQualify(DelegatingScope.java:259)
~[flink-table_2.11-1.11-SNAPSHOT.jar:1.11-SNAPSHOT]
        at org.apache.calcite.sql.validate.SqlValidatorImpl$DeriveTypeVisitor.visit(SqlValidatorImpl.java:5882)
~[flink-table_2.11-1.11-SNAPSHOT.jar:1.11-SNAPSHOT]
        at org.apache.calcite.sql.validate.SqlValidatorImpl$DeriveTypeVisitor.visit(SqlValidatorImpl.java:5845)
~[flink-table_2.11-1.11-SNAPSHOT.jar:1.11-SNAPSHOT]
        at org.apache.calcite.sql.SqlIdentifier.accept(SqlIdentifier.java:321)
~[flink-table_2.11-1.11-SNAPSHOT.jar:1.11-SNAPSHOT]
        at org.apache.calcite.sql.validate.SqlValidatorImpl.deriveTypeImpl(SqlValidatorImpl.java:1800)
~[flink-table_2.11-1.11-SNAPSHOT.jar:1.11-SNAPSHOT]
        at org.apache.calcite.sql.validate.SqlValidatorImpl.deriveType(SqlValidatorImpl.java:1785)
~[flink-table_2.11-1.11-SNAPSHOT.jar:1.11-SNAPSHOT]
        at org.apache.calcite.sql.SqlCallBinding.getOperandType(SqlCallBinding.java:237)
~[flink-table_2.11-1.11-SNAPSHOT.jar:1.11-SNAPSHOT]
        at org.apache.flink.table.planner.functions.utils.UserDefinedFunctionUtils$$anonfun$12.apply(UserDefinedFunctionUtils.scala:788)
~[flink-table-blink_2.11-1.11-SNAPSHOT.jar:1.11-SNAPSHOT]
        at org.apache.flink.table.planner.functions.utils.UserDefinedFunctionUtils$$anonfun$12.apply(UserDefinedFunctionUtils.scala:787)
~[flink-table-blink_2.11-1.11-SNAPSHOT.jar:1.11-SNAPSHOT]
        at scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:234)
~[flink-dist_2.11-1.11-SNAPSHOT.jar:1.11-SNAPSHOT]
        at scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:234)
~[flink-dist_2.11-1.11-SNAPSHOT.jar:1.11-SNAPSHOT]
        at scala.collection.immutable.Range.foreach(Range.scala:160)
~[flink-dist_2.11-1.11-SNAPSHOT.jar:1.11-SNAPSHOT]
        at scala.collection.TraversableLike$class.map(TraversableLike.scala:234)
~[flink-dist_2.11-1.11-SNAPSHOT.jar:1.11-SNAPSHOT]
        at scala.collection.AbstractTraversable.map(Traversable.scala:104)
~[flink-dist_2.11-1.11-SNAPSHOT.jar:1.11-SNAPSHOT]
        at org.apache.flink.table.planner.functions.utils.UserDefinedFunctionUtils$.getOperandType(UserDefinedFunctionUtils.scala:787)
~[flink-table-blink_2.11-1.11-SNAPSHOT.jar:1.11-SNAPSHOT]
        at org.apache.flink.table.planner.functions.utils.ScalarSqlFunction$.inferOperandTypes(ScalarSqlFunction.scala:116)
~[flink-table-blink_2.11-1.11-SNAPSHOT.jar:1.11-SNAPSHOT]
        at org.apache.flink.table.planner.functions.utils.ScalarSqlFunction$$anon$2.inferOperandTypes(ScalarSqlFunction.scala:103)
~[flink-table-blink_2.11-1.11-SNAPSHOT.jar:1.11-SNAPSHOT]
        at org.apache.calcite.sql.validate.SqlValidatorImpl.inferUnknownTypes(SqlValidatorImpl.java:1980)
~[flink-table_2.11-1.11-SNAPSHOT.jar:1.11-SNAPSHOT]
        at org.apache.calcite.sql.validate.SqlValidatorImpl.inferUnknownTypes(SqlValidatorImpl.java:1988)
~[flink-table_2.11-1.11-SNAPSHOT.jar:1.11-SNAPSHOT]
        at org.apache.calcite.sql.validate.SqlValidatorImpl.inferUnknownTypes(SqlValidatorImpl.java:1951)
~[flink-table_2.11-1.11-SNAPSHOT.jar:1.11-SNAPSHOT]
        at org.apache.calcite.sql.validate.SqlValidatorImpl.inferUnknownTypes(SqlValidatorImpl.java:1988)
~[flink-table_2.11-1.11-SNAPSHOT.jar:1.11-SNAPSHOT]
        at org.apache.calcite.sql.validate.ProcedureNamespace.validateImpl(ProcedureNamespace.java:56)
~[flink-table_2.11-1.11-SNAPSHOT.jar:1.11-SNAPSHOT]
        at org.apache.calcite.sql.validate.AbstractNamespace.validate(AbstractNamespace.java:84)
~[flink-table_2.11-1.11-SNAPSHOT.jar:1.11-SNAPSHOT]
        at org.apache.calcite.sql.validate.SqlValidatorImpl.validateNamespace(SqlValidatorImpl.java:1110)
~[flink-table_2.11-1.11-SNAPSHOT.jar:1.11-SNAPSHOT]
        at org.apache.calcite.sql.validate.SqlValidatorImpl.validateQuery(SqlValidatorImpl.java:1084)
~[flink-table_2.11-1.11-SNAPSHOT.jar:1.11-SNAPSHOT]
        at org.apache.calcite.sql.validate.SqlValidatorImpl.validateFrom(SqlValidatorImpl.java:3256)
~[flink-table_2.11-1.11-SNAPSHOT.jar:1.11-SNAPSHOT]
        at org.apache.calcite.sql.validate.SqlValidatorImpl.validateFrom(SqlValidatorImpl.java:3238)
~[flink-table_2.11-1.11-SNAPSHOT.jar:1.11-SNAPSHOT]
        at org.apache.calcite.sql.validate.SqlValidatorImpl.validateJoin(SqlValidatorImpl.java:3303)
~[flink-table_2.11-1.11-SNAPSHOT.jar:1.11-SNAPSHOT]
        at org.apache.flink.table.planner.calcite.FlinkCalciteSqlValidator.validateJoin(FlinkCalciteSqlValidator.java:86)
~[flink-table-blink_2.11-1.11-SNAPSHOT.jar:1.11-SNAPSHOT]
        at org.apache.calcite.sql.validate.SqlValidatorImpl.validateFrom(SqlValidatorImpl.java:3247)
~[flink-table_2.11-1.11-SNAPSHOT.jar:1.11-SNAPSHOT]
        at org.apache.calcite.sql.validate.SqlValidatorImpl.validateSelect(SqlValidatorImpl.java:3510)
~[flink-table_2.11-1.11-SNAPSHOT.jar:1.11-SNAPSHOT]
        at org.apache.calcite.sql.validate.SelectNamespace.validateImpl(SelectNamespace.java:60)
~[flink-table_2.11-1.11-SNAPSHOT.jar:1.11-SNAPSHOT]
        at org.apache.calcite.sql.validate.AbstractNamespace.validate(AbstractNamespace.java:84)
~[flink-table_2.11-1.11-SNAPSHOT.jar:1.11-SNAPSHOT]
        at org.apache.calcite.sql.validate.SqlValidatorImpl.validateNamespace(SqlValidatorImpl.java:1110)
~[flink-table_2.11-1.11-SNAPSHOT.jar:1.11-SNAPSHOT]
        at org.apache.calcite.sql.validate.SqlValidatorImpl.validateQuery(SqlValidatorImpl.java:1084)
~[flink-table_2.11-1.11-SNAPSHOT.jar:1.11-SNAPSHOT]
        at org.apache.calcite.sql.SqlSelect.validate(SqlSelect.java:232)
~[flink-table_2.11-1.11-SNAPSHOT.jar:1.11-SNAPSHOT]
        at org.apache.calcite.sql.validate.SqlValidatorImpl.validateScopedExpression(SqlValidatorImpl.java:1059)
~[flink-table_2.11-1.11-SNAPSHOT.jar:1.11-SNAPSHOT]
        at org.apache.calcite.sql.validate.SqlValidatorImpl.validate(SqlValidatorImpl.java:766)
~[flink-table_2.11-1.11-SNAPSHOT.jar:1.11-SNAPSHOT]
        at org.apache.flink.table.planner.calcite.FlinkPlannerImpl.org$apache$flink$table$planner$calcite$FlinkPlannerImpl$$validate(FlinkPlannerImpl.scala:141)
~[flink-table-blink_2.11-1.11-SNAPSHOT.jar:1.11-SNAPSHOT]
        at org.apache.flink.table.planner.calcite.FlinkPlannerImpl$ToRelContextImpl.expandView(FlinkPlannerImpl.scala:204)
~[flink-table-blink_2.11-1.11-SNAPSHOT.jar:1.11-SNAPSHOT]
        at org.apache.calcite.plan.ViewExpanders$1.expandView(ViewExpanders.java:52)
~[flink-table_2.11-1.11-SNAPSHOT.jar:1.11-SNAPSHOT]
        at org.apache.flink.table.planner.catalog.SqlCatalogViewTable.convertToRel(SqlCatalogViewTable.java:58)
~[flink-table-blink_2.11-1.11-SNAPSHOT.jar:1.11-SNAPSHOT]
        at org.apache.flink.table.planner.plan.schema.ExpandingPreparingTable.expand(ExpandingPreparingTable.java:59)
~[flink-table-blink_2.11-1.11-SNAPSHOT.jar:1.11-SNAPSHOT]
        at org.apache.flink.table.planner.plan.schema.ExpandingPreparingTable.toRel(ExpandingPreparingTable.java:55)
~[flink-table-blink_2.11-1.11-SNAPSHOT.jar:1.11-SNAPSHOT]
        at org.apache.calcite.sql2rel.SqlToRelConverter.toRel(SqlToRelConverter.java:3492)
~[flink-table_2.11-1.11-SNAPSHOT.jar:1.11-SNAPSHOT]
        at org.apache.calcite.sql2rel.SqlToRelConverter.convertIdentifier(SqlToRelConverter.java:2415)
~[flink-table_2.11-1.11-SNAPSHOT.jar:1.11-SNAPSHOT]
        at org.apache.calcite.sql2rel.SqlToRelConverter.convertFrom(SqlToRelConverter.java:2102)
~[flink-table_2.11-1.11-SNAPSHOT.jar:1.11-SNAPSHOT]
        at org.apache.calcite.sql2rel.SqlToRelConverter.convertFrom(SqlToRelConverter.java:2051)
~[flink-table_2.11-1.11-SNAPSHOT.jar:1.11-SNAPSHOT]
        at org.apache.calcite.sql2rel.SqlToRelConverter.convertSelectImpl(SqlToRelConverter.java:661)
~[flink-table_2.11-1.11-SNAPSHOT.jar:1.11-SNAPSHOT]
        at org.apache.calcite.sql2rel.SqlToRelConverter.convertSelect(SqlToRelConverter.java:642)
~[flink-table_2.11-1.11-SNAPSHOT.jar:1.11-SNAPSHOT]
        at org.apache.calcite.sql2rel.SqlToRelConverter.convertQueryRecursive(SqlToRelConverter.java:3345)
~[flink-table_2.11-1.11-SNAPSHOT.jar:1.11-SNAPSHOT]
        at org.apache.calcite.sql2rel.SqlToRelConverter.convertQuery(SqlToRelConverter.java:568)
~[flink-table_2.11-1.11-SNAPSHOT.jar:1.11-SNAPSHOT]
        at org.apache.flink.table.planner.calcite.FlinkPlannerImpl.org$apache$flink$table$planner$calcite$FlinkPlannerImpl$$rel(FlinkPlannerImpl.scala:164)
~[flink-table-blink_2.11-1.11-SNAPSHOT.jar:1.11-SNAPSHOT]
        at org.apache.flink.table.planner.calcite.FlinkPlannerImpl.rel(FlinkPlannerImpl.scala:151)
~[flink-table-blink_2.11-1.11-SNAPSHOT.jar:1.11-SNAPSHOT]
        at org.apache.flink.table.planner.operations.SqlToOperationConverter.toQueryOperation(SqlToOperationConverter.java:774)
~[flink-table-blink_2.11-1.11-SNAPSHOT.jar:1.11-SNAPSHOT]
        at org.apache.flink.table.planner.operations.SqlToOperationConverter.convertSqlQuery(SqlToOperationConverter.java:746)
~[flink-table-blink_2.11-1.11-SNAPSHOT.jar:1.11-SNAPSHOT]
        at org.apache.flink.table.planner.operations.SqlToOperationConverter.convert(SqlToOperationConverter.java:236)
~[flink-table-blink_2.11-1.11-SNAPSHOT.jar:1.11-SNAPSHOT]
        at org.apache.flink.table.planner.delegation.ParserImpl.parse(ParserImpl.java:78)
~[flink-table-blink_2.11-1.11-SNAPSHOT.jar:1.11-SNAPSHOT]
        at org.apache.flink.table.client.gateway.local.LocalExecutor$1.lambda$parse$0(LocalExecutor.java:430)
~[flink-sql-client_2.11-1.11-SNAPSHOT.jar:1.11-SNAPSHOT]
        at org.apache.flink.table.client.gateway.local.ExecutionContext.wrapClassLoader(ExecutionContext.java:255)
~[flink-sql-client_2.11-1.11-SNAPSHOT.jar:1.11-SNAPSHOT]
        at org.apache.flink.table.client.gateway.local.LocalExecutor$1.parse(LocalExecutor.java:430)
~[flink-sql-client_2.11-1.11-SNAPSHOT.jar:1.11-SNAPSHOT]
        at org.apache.flink.table.client.cli.SqlCommandParser.parseBySqlParser(SqlCommandParser.java:97)
~[flink-sql-client_2.11-1.11-SNAPSHOT.jar:1.11-SNAPSHOT]
Reply | Threaded
Open this post in threaded view
|

Re: flink sql多层view嵌套,字段not found

Danny Chan
这是一个已知问题,社区版本已经修复了 [1],不过还有一个后续 PR https://github.com/apache/flink/pull/13293,待 merge

[1] https://issues.apache.org/jira/browse/FLINK-18750

Best,
Danny Chan
在 2020年9月3日 +0800 PM6:41,Lin Hou <[hidden email]>,写道:

> Hi,
>
> 请教一个通过sql-client提交flink sql遇到的关于嵌套view,当嵌套第二层时,查询时会报找不到字段的问题。
> 元数据已经建好,简述如下:
>
> 1.建嵌套的view:
>
> create temporary view temp_app_impression_5min as
> select
> argService as arg_service,
> timeLocal as time_local,
> mid as mid,
> vipruid as vipruid,
> activity as activity,
> LOWER(activityProperty) as activity_property
> from
> vipdwd.clean;
>
> create temporary view v1_1 as
> select
> get_json_object(activity_property, '$.page') as impression_page,
> SPLIT_INDEX(good, '_', 0) as sales_no,
> good,
> imp.*
> from
> temp_app_impression_5min as imp, lateral table (
> string_split(
> COALESCE(
> get_json_object(activity_property, '$.goodslist'),
> ''
> ),
> ','
> )
> ) as T(good)
> where
> activity = 'active';
>
> 2. 描述view:
>
> 两个view建好没有问题,
> 同时 desc v1_1 如下:
>
> Flink SQL> desc v1_1;root
> |-- impression_page: STRING
> |-- sales_no: VARCHAR(2000)
> |-- good: STRING
> |-- arg_service: STRING
> |-- time_local: BIGINT
> |-- mid: STRING
> |-- vipruid: BIGINT
> |-- activity: STRING
> |-- activity_property: STRING
>
> 可见字段activity_property存在于v1_1中,
>
> 3.执行:
>
> 但是当执行:
> select
> *
> from
> v1_1;
>
> 出错:[ERROR] Could not execute SQL statement. Reason:
>
> org.apache.calcite.sql.validate.SqlValidatorException: Column
> 'activity_property' not found in any table
>
> 一层view的时候查询没有问题,当嵌套view的时候就会报这个错,哪怕生成这个view的时候指定这个字段都不行:
>
> create temporary view v1_1 as
> select
> get_json_object(activity_property, '$.page') as impression_page,
> SPLIT_INDEX(good, '_', 0) as sales_no,
> good,
> imp.*,
>
> activity_property
>
> from
> temp_app_impression_5min as imp, lateral table (
> string_split(
> COALESCE(
> get_json_object(activity_property, '$.goodslist'),
> ''
> ),
> ','
> )
> ) as T(good)
> where
> activity = 'active';
>
>
> 请问有解决办法么,或者是我们用的方式不对。
>
>
> 完整调用栈日志:
>
> org.apache.flink.table.client.gateway.SqlExecutionException:
> Invalidate SQL statement.
> at org.apache.flink.table.client.cli.SqlCommandParser.parseBySqlParser(SqlCommandParser.java:99)
> ~[flink-sql-client_2.11-1.11-SNAPSHOT.jar:1.11-SNAPSHOT]
> at org.apache.flink.table.client.cli.SqlCommandParser.parse(SqlCommandParser.java:90)
> ~[flink-sql-client_2.11-1.11-SNAPSHOT.jar:1.11-SNAPSHOT]
> at org.apache.flink.table.client.cli.CliClient.parseCommand(CliClient.java:257)
> [flink-sql-client_2.11-1.11-SNAPSHOT.jar:1.11-SNAPSHOT]
> at org.apache.flink.table.client.cli.CliClient.open(CliClient.java:211)
> [flink-sql-client_2.11-1.11-SNAPSHOT.jar:1.11-SNAPSHOT]
> at org.apache.flink.table.client.SqlClient.openCli(SqlClient.java:142)
> [flink-sql-client_2.11-1.11-SNAPSHOT.jar:1.11-SNAPSHOT]
> at org.apache.flink.table.client.SqlClient.start(SqlClient.java:114)
> [flink-sql-client_2.11-1.11-SNAPSHOT.jar:1.11-SNAPSHOT]
> at org.apache.flink.table.client.SqlClient.main(SqlClient.java:201)
> [flink-sql-client_2.11-1.11-SNAPSHOT.jar:1.11-SNAPSHOT]
> Caused by: org.apache.flink.table.api.ValidationException: SQL
> validation failed. From line 3, column 84 to line 3, column 102:
> Column 'activity_property' not found in any table
> at org.apache.flink.table.planner.calcite.FlinkPlannerImpl.org$apache$flink$table$planner$calcite$FlinkPlannerImpl$$validate(FlinkPlannerImpl.scala:146)
> ~[flink-table-blink_2.11-1.11-SNAPSHOT.jar:1.11-SNAPSHOT]
> at org.apache.flink.table.planner.calcite.FlinkPlannerImpl$ToRelContextImpl.expandView(FlinkPlannerImpl.scala:204)
> ~[flink-table-blink_2.11-1.11-SNAPSHOT.jar:1.11-SNAPSHOT]
> at org.apache.calcite.plan.ViewExpanders$1.expandView(ViewExpanders.java:52)
> ~[flink-table_2.11-1.11-SNAPSHOT.jar:1.11-SNAPSHOT]
> at org.apache.flink.table.planner.catalog.SqlCatalogViewTable.convertToRel(SqlCatalogViewTable.java:58)
> ~[flink-table-blink_2.11-1.11-SNAPSHOT.jar:1.11-SNAPSHOT]
> at org.apache.flink.table.planner.plan.schema.ExpandingPreparingTable.expand(ExpandingPreparingTable.java:59)
> ~[flink-table-blink_2.11-1.11-SNAPSHOT.jar:1.11-SNAPSHOT]
> at org.apache.flink.table.planner.plan.schema.ExpandingPreparingTable.toRel(ExpandingPreparingTable.java:55)
> ~[flink-table-blink_2.11-1.11-SNAPSHOT.jar:1.11-SNAPSHOT]
> at org.apache.calcite.sql2rel.SqlToRelConverter.toRel(SqlToRelConverter.java:3492)
> ~[flink-table_2.11-1.11-SNAPSHOT.jar:1.11-SNAPSHOT]
> at org.apache.calcite.sql2rel.SqlToRelConverter.convertIdentifier(SqlToRelConverter.java:2415)
> ~[flink-table_2.11-1.11-SNAPSHOT.jar:1.11-SNAPSHOT]
> at org.apache.calcite.sql2rel.SqlToRelConverter.convertFrom(SqlToRelConverter.java:2102)
> ~[flink-table_2.11-1.11-SNAPSHOT.jar:1.11-SNAPSHOT]
> at org.apache.calcite.sql2rel.SqlToRelConverter.convertFrom(SqlToRelConverter.java:2051)
> ~[flink-table_2.11-1.11-SNAPSHOT.jar:1.11-SNAPSHOT]
> at org.apache.calcite.sql2rel.SqlToRelConverter.convertSelectImpl(SqlToRelConverter.java:661)
> ~[flink-table_2.11-1.11-SNAPSHOT.jar:1.11-SNAPSHOT]
> at org.apache.calcite.sql2rel.SqlToRelConverter.convertSelect(SqlToRelConverter.java:642)
> ~[flink-table_2.11-1.11-SNAPSHOT.jar:1.11-SNAPSHOT]
> at org.apache.calcite.sql2rel.SqlToRelConverter.convertQueryRecursive(SqlToRelConverter.java:3345)
> ~[flink-table_2.11-1.11-SNAPSHOT.jar:1.11-SNAPSHOT]
> at org.apache.calcite.sql2rel.SqlToRelConverter.convertQuery(SqlToRelConverter.java:568)
> ~[flink-table_2.11-1.11-SNAPSHOT.jar:1.11-SNAPSHOT]
> at org.apache.flink.table.planner.calcite.FlinkPlannerImpl.org$apache$flink$table$planner$calcite$FlinkPlannerImpl$$rel(FlinkPlannerImpl.scala:164)
> ~[flink-table-blink_2.11-1.11-SNAPSHOT.jar:1.11-SNAPSHOT]
> at org.apache.flink.table.planner.calcite.FlinkPlannerImpl.rel(FlinkPlannerImpl.scala:151)
> ~[flink-table-blink_2.11-1.11-SNAPSHOT.jar:1.11-SNAPSHOT]
> at org.apache.flink.table.planner.operations.SqlToOperationConverter.toQueryOperation(SqlToOperationConverter.java:774)
> ~[flink-table-blink_2.11-1.11-SNAPSHOT.jar:1.11-SNAPSHOT]
> at org.apache.flink.table.planner.operations.SqlToOperationConverter.convertSqlQuery(SqlToOperationConverter.java:746)
> ~[flink-table-blink_2.11-1.11-SNAPSHOT.jar:1.11-SNAPSHOT]
> at org.apache.flink.table.planner.operations.SqlToOperationConverter.convert(SqlToOperationConverter.java:236)
> ~[flink-table-blink_2.11-1.11-SNAPSHOT.jar:1.11-SNAPSHOT]
> at org.apache.flink.table.planner.delegation.ParserImpl.parse(ParserImpl.java:78)
> ~[flink-table-blink_2.11-1.11-SNAPSHOT.jar:1.11-SNAPSHOT]
> at org.apache.flink.table.client.gateway.local.LocalExecutor$1.lambda$parse$0(LocalExecutor.java:430)
> ~[flink-sql-client_2.11-1.11-SNAPSHOT.jar:1.11-SNAPSHOT]
> at org.apache.flink.table.client.gateway.local.ExecutionContext.wrapClassLoader(ExecutionContext.java:255)
> ~[flink-sql-client_2.11-1.11-SNAPSHOT.jar:1.11-SNAPSHOT]
> at org.apache.flink.table.client.gateway.local.LocalExecutor$1.parse(LocalExecutor.java:430)
> ~[flink-sql-client_2.11-1.11-SNAPSHOT.jar:1.11-SNAPSHOT]
> at org.apache.flink.table.client.cli.SqlCommandParser.parseBySqlParser(SqlCommandParser.java:97)
> ~[flink-sql-client_2.11-1.11-SNAPSHOT.jar:1.11-SNAPSHOT]
> ... 6 more
> Caused by: org.apache.calcite.runtime.CalciteContextException: From
> line 3, column 84 to line 3, column 102: Column 'activity_property'
> not found in any table
> at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native
> Method) ~[?:1.8.0_262]
> at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
> ~[?:1.8.0_262]
> at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
> ~[?:1.8.0_262]
> at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
> ~[?:1.8.0_262]
> at org.apache.calcite.runtime.Resources$ExInstWithCause.ex(Resources.java:457)
> ~[flink-table_2.11-1.11-SNAPSHOT.jar:1.11-SNAPSHOT]
> at org.apache.calcite.sql.SqlUtil.newContextException(SqlUtil.java:839)
> ~[flink-table_2.11-1.11-SNAPSHOT.jar:1.11-SNAPSHOT]
> at org.apache.calcite.sql.SqlUtil.newContextException(SqlUtil.java:824)
> ~[flink-table_2.11-1.11-SNAPSHOT.jar:1.11-SNAPSHOT]
> at org.apache.calcite.sql.validate.SqlValidatorImpl.newValidationError(SqlValidatorImpl.java:5089)
> ~[flink-table_2.11-1.11-SNAPSHOT.jar:1.11-SNAPSHOT]
> at org.apache.calcite.sql.validate.DelegatingScope.fullyQualify(DelegatingScope.java:259)
> ~[flink-table_2.11-1.11-SNAPSHOT.jar:1.11-SNAPSHOT]
> at org.apache.calcite.sql.validate.SqlValidatorImpl$DeriveTypeVisitor.visit(SqlValidatorImpl.java:5882)
> ~[flink-table_2.11-1.11-SNAPSHOT.jar:1.11-SNAPSHOT]
> at org.apache.calcite.sql.validate.SqlValidatorImpl$DeriveTypeVisitor.visit(SqlValidatorImpl.java:5845)
> ~[flink-table_2.11-1.11-SNAPSHOT.jar:1.11-SNAPSHOT]
> at org.apache.calcite.sql.SqlIdentifier.accept(SqlIdentifier.java:321)
> ~[flink-table_2.11-1.11-SNAPSHOT.jar:1.11-SNAPSHOT]
> at org.apache.calcite.sql.validate.SqlValidatorImpl.deriveTypeImpl(SqlValidatorImpl.java:1800)
> ~[flink-table_2.11-1.11-SNAPSHOT.jar:1.11-SNAPSHOT]
> at org.apache.calcite.sql.validate.SqlValidatorImpl.deriveType(SqlValidatorImpl.java:1785)
> ~[flink-table_2.11-1.11-SNAPSHOT.jar:1.11-SNAPSHOT]
> at org.apache.calcite.sql.SqlCallBinding.getOperandType(SqlCallBinding.java:237)
> ~[flink-table_2.11-1.11-SNAPSHOT.jar:1.11-SNAPSHOT]
> at org.apache.flink.table.planner.functions.utils.UserDefinedFunctionUtils$$anonfun$12.apply(UserDefinedFunctionUtils.scala:788)
> ~[flink-table-blink_2.11-1.11-SNAPSHOT.jar:1.11-SNAPSHOT]
> at org.apache.flink.table.planner.functions.utils.UserDefinedFunctionUtils$$anonfun$12.apply(UserDefinedFunctionUtils.scala:787)
> ~[flink-table-blink_2.11-1.11-SNAPSHOT.jar:1.11-SNAPSHOT]
> at scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:234)
> ~[flink-dist_2.11-1.11-SNAPSHOT.jar:1.11-SNAPSHOT]
> at scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:234)
> ~[flink-dist_2.11-1.11-SNAPSHOT.jar:1.11-SNAPSHOT]
> at scala.collection.immutable.Range.foreach(Range.scala:160)
> ~[flink-dist_2.11-1.11-SNAPSHOT.jar:1.11-SNAPSHOT]
> at scala.collection.TraversableLike$class.map(TraversableLike.scala:234)
> ~[flink-dist_2.11-1.11-SNAPSHOT.jar:1.11-SNAPSHOT]
> at scala.collection.AbstractTraversable.map(Traversable.scala:104)
> ~[flink-dist_2.11-1.11-SNAPSHOT.jar:1.11-SNAPSHOT]
> at org.apache.flink.table.planner.functions.utils.UserDefinedFunctionUtils$.getOperandType(UserDefinedFunctionUtils.scala:787)
> ~[flink-table-blink_2.11-1.11-SNAPSHOT.jar:1.11-SNAPSHOT]
> at org.apache.flink.table.planner.functions.utils.ScalarSqlFunction$.inferOperandTypes(ScalarSqlFunction.scala:116)
> ~[flink-table-blink_2.11-1.11-SNAPSHOT.jar:1.11-SNAPSHOT]
> at org.apache.flink.table.planner.functions.utils.ScalarSqlFunction$$anon$2.inferOperandTypes(ScalarSqlFunction.scala:103)
> ~[flink-table-blink_2.11-1.11-SNAPSHOT.jar:1.11-SNAPSHOT]
> at org.apache.calcite.sql.validate.SqlValidatorImpl.inferUnknownTypes(SqlValidatorImpl.java:1980)
> ~[flink-table_2.11-1.11-SNAPSHOT.jar:1.11-SNAPSHOT]
> at org.apache.calcite.sql.validate.SqlValidatorImpl.inferUnknownTypes(SqlValidatorImpl.java:1988)
> ~[flink-table_2.11-1.11-SNAPSHOT.jar:1.11-SNAPSHOT]
> at org.apache.calcite.sql.validate.SqlValidatorImpl.inferUnknownTypes(SqlValidatorImpl.java:1951)
> ~[flink-table_2.11-1.11-SNAPSHOT.jar:1.11-SNAPSHOT]
> at org.apache.calcite.sql.validate.SqlValidatorImpl.inferUnknownTypes(SqlValidatorImpl.java:1988)
> ~[flink-table_2.11-1.11-SNAPSHOT.jar:1.11-SNAPSHOT]
> at org.apache.calcite.sql.validate.ProcedureNamespace.validateImpl(ProcedureNamespace.java:56)
> ~[flink-table_2.11-1.11-SNAPSHOT.jar:1.11-SNAPSHOT]
> at org.apache.calcite.sql.validate.AbstractNamespace.validate(AbstractNamespace.java:84)
> ~[flink-table_2.11-1.11-SNAPSHOT.jar:1.11-SNAPSHOT]
> at org.apache.calcite.sql.validate.SqlValidatorImpl.validateNamespace(SqlValidatorImpl.java:1110)
> ~[flink-table_2.11-1.11-SNAPSHOT.jar:1.11-SNAPSHOT]
> at org.apache.calcite.sql.validate.SqlValidatorImpl.validateQuery(SqlValidatorImpl.java:1084)
> ~[flink-table_2.11-1.11-SNAPSHOT.jar:1.11-SNAPSHOT]
> at org.apache.calcite.sql.validate.SqlValidatorImpl.validateFrom(SqlValidatorImpl.java:3256)
> ~[flink-table_2.11-1.11-SNAPSHOT.jar:1.11-SNAPSHOT]
> at org.apache.calcite.sql.validate.SqlValidatorImpl.validateFrom(SqlValidatorImpl.java:3238)
> ~[flink-table_2.11-1.11-SNAPSHOT.jar:1.11-SNAPSHOT]
> at org.apache.calcite.sql.validate.SqlValidatorImpl.validateJoin(SqlValidatorImpl.java:3303)
> ~[flink-table_2.11-1.11-SNAPSHOT.jar:1.11-SNAPSHOT]
> at org.apache.flink.table.planner.calcite.FlinkCalciteSqlValidator.validateJoin(FlinkCalciteSqlValidator.java:86)
> ~[flink-table-blink_2.11-1.11-SNAPSHOT.jar:1.11-SNAPSHOT]
> at org.apache.calcite.sql.validate.SqlValidatorImpl.validateFrom(SqlValidatorImpl.java:3247)
> ~[flink-table_2.11-1.11-SNAPSHOT.jar:1.11-SNAPSHOT]
> at org.apache.calcite.sql.validate.SqlValidatorImpl.validateSelect(SqlValidatorImpl.java:3510)
> ~[flink-table_2.11-1.11-SNAPSHOT.jar:1.11-SNAPSHOT]
> at org.apache.calcite.sql.validate.SelectNamespace.validateImpl(SelectNamespace.java:60)
> ~[flink-table_2.11-1.11-SNAPSHOT.jar:1.11-SNAPSHOT]
> at org.apache.calcite.sql.validate.AbstractNamespace.validate(AbstractNamespace.java:84)
> ~[flink-table_2.11-1.11-SNAPSHOT.jar:1.11-SNAPSHOT]
> at org.apache.calcite.sql.validate.SqlValidatorImpl.validateNamespace(SqlValidatorImpl.java:1110)
> ~[flink-table_2.11-1.11-SNAPSHOT.jar:1.11-SNAPSHOT]
> at org.apache.calcite.sql.validate.SqlValidatorImpl.validateQuery(SqlValidatorImpl.java:1084)
> ~[flink-table_2.11-1.11-SNAPSHOT.jar:1.11-SNAPSHOT]
> at org.apache.calcite.sql.SqlSelect.validate(SqlSelect.java:232)
> ~[flink-table_2.11-1.11-SNAPSHOT.jar:1.11-SNAPSHOT]
> at org.apache.calcite.sql.validate.SqlValidatorImpl.validateScopedExpression(SqlValidatorImpl.java:1059)
> ~[flink-table_2.11-1.11-SNAPSHOT.jar:1.11-SNAPSHOT]
> at org.apache.calcite.sql.validate.SqlValidatorImpl.validate(SqlValidatorImpl.java:766)
> ~[flink-table_2.11-1.11-SNAPSHOT.jar:1.11-SNAPSHOT]
> at org.apache.flink.table.planner.calcite.FlinkPlannerImpl.org$apache$flink$table$planner$calcite$FlinkPlannerImpl$$validate(FlinkPlannerImpl.scala:141)
> ~[flink-table-blink_2.11-1.11-SNAPSHOT.jar:1.11-SNAPSHOT]
> at org.apache.flink.table.planner.calcite.FlinkPlannerImpl$ToRelContextImpl.expandView(FlinkPlannerImpl.scala:204)
> ~[flink-table-blink_2.11-1.11-SNAPSHOT.jar:1.11-SNAPSHOT]
> at org.apache.calcite.plan.ViewExpanders$1.expandView(ViewExpanders.java:52)
> ~[flink-table_2.11-1.11-SNAPSHOT.jar:1.11-SNAPSHOT]
> at org.apache.flink.table.planner.catalog.SqlCatalogViewTable.convertToRel(SqlCatalogViewTable.java:58)
> ~[flink-table-blink_2.11-1.11-SNAPSHOT.jar:1.11-SNAPSHOT]
> at org.apache.flink.table.planner.plan.schema.ExpandingPreparingTable.expand(ExpandingPreparingTable.java:59)
> ~[flink-table-blink_2.11-1.11-SNAPSHOT.jar:1.11-SNAPSHOT]
> at org.apache.flink.table.planner.plan.schema.ExpandingPreparingTable.toRel(ExpandingPreparingTable.java:55)
> ~[flink-table-blink_2.11-1.11-SNAPSHOT.jar:1.11-SNAPSHOT]
> at org.apache.calcite.sql2rel.SqlToRelConverter.toRel(SqlToRelConverter.java:3492)
> ~[flink-table_2.11-1.11-SNAPSHOT.jar:1.11-SNAPSHOT]
> at org.apache.calcite.sql2rel.SqlToRelConverter.convertIdentifier(SqlToRelConverter.java:2415)
> ~[flink-table_2.11-1.11-SNAPSHOT.jar:1.11-SNAPSHOT]
> at org.apache.calcite.sql2rel.SqlToRelConverter.convertFrom(SqlToRelConverter.java:2102)
> ~[flink-table_2.11-1.11-SNAPSHOT.jar:1.11-SNAPSHOT]
> at org.apache.calcite.sql2rel.SqlToRelConverter.convertFrom(SqlToRelConverter.java:2051)
> ~[flink-table_2.11-1.11-SNAPSHOT.jar:1.11-SNAPSHOT]
> at org.apache.calcite.sql2rel.SqlToRelConverter.convertSelectImpl(SqlToRelConverter.java:661)
> ~[flink-table_2.11-1.11-SNAPSHOT.jar:1.11-SNAPSHOT]
> at org.apache.calcite.sql2rel.SqlToRelConverter.convertSelect(SqlToRelConverter.java:642)
> ~[flink-table_2.11-1.11-SNAPSHOT.jar:1.11-SNAPSHOT]
> at org.apache.calcite.sql2rel.SqlToRelConverter.convertQueryRecursive(SqlToRelConverter.java:3345)
> ~[flink-table_2.11-1.11-SNAPSHOT.jar:1.11-SNAPSHOT]
> at org.apache.calcite.sql2rel.SqlToRelConverter.convertQuery(SqlToRelConverter.java:568)
> ~[flink-table_2.11-1.11-SNAPSHOT.jar:1.11-SNAPSHOT]
> at org.apache.flink.table.planner.calcite.FlinkPlannerImpl.org$apache$flink$table$planner$calcite$FlinkPlannerImpl$$rel(FlinkPlannerImpl.scala:164)
> ~[flink-table-blink_2.11-1.11-SNAPSHOT.jar:1.11-SNAPSHOT]
> at org.apache.flink.table.planner.calcite.FlinkPlannerImpl.rel(FlinkPlannerImpl.scala:151)
> ~[flink-table-blink_2.11-1.11-SNAPSHOT.jar:1.11-SNAPSHOT]
> at org.apache.flink.table.planner.operations.SqlToOperationConverter.toQueryOperation(SqlToOperationConverter.java:774)
> ~[flink-table-blink_2.11-1.11-SNAPSHOT.jar:1.11-SNAPSHOT]
> at org.apache.flink.table.planner.operations.SqlToOperationConverter.convertSqlQuery(SqlToOperationConverter.java:746)
> ~[flink-table-blink_2.11-1.11-SNAPSHOT.jar:1.11-SNAPSHOT]
> at org.apache.flink.table.planner.operations.SqlToOperationConverter.convert(SqlToOperationConverter.java:236)
> ~[flink-table-blink_2.11-1.11-SNAPSHOT.jar:1.11-SNAPSHOT]
> at org.apache.flink.table.planner.delegation.ParserImpl.parse(ParserImpl.java:78)
> ~[flink-table-blink_2.11-1.11-SNAPSHOT.jar:1.11-SNAPSHOT]
> at org.apache.flink.table.client.gateway.local.LocalExecutor$1.lambda$parse$0(LocalExecutor.java:430)
> ~[flink-sql-client_2.11-1.11-SNAPSHOT.jar:1.11-SNAPSHOT]
> at org.apache.flink.table.client.gateway.local.ExecutionContext.wrapClassLoader(ExecutionContext.java:255)
> ~[flink-sql-client_2.11-1.11-SNAPSHOT.jar:1.11-SNAPSHOT]
> at org.apache.flink.table.client.gateway.local.LocalExecutor$1.parse(LocalExecutor.java:430)
> ~[flink-sql-client_2.11-1.11-SNAPSHOT.jar:1.11-SNAPSHOT]
> at org.apache.flink.table.client.cli.SqlCommandParser.parseBySqlParser(SqlCommandParser.java:97)
> ~[flink-sql-client_2.11-1.11-SNAPSHOT.jar:1.11-SNAPSHOT]
> ... 6 more
> Caused by: org.apache.calcite.sql.validate.SqlValidatorException:
> Column 'activity_property' not found in any table
> at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native
> Method) ~[?:1.8.0_262]
> at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
> ~[?:1.8.0_262]
> at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
> ~[?:1.8.0_262]
> at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
> ~[?:1.8.0_262]
> at org.apache.calcite.runtime.Resources$ExInstWithCause.ex(Resources.java:457)
> ~[flink-table_2.11-1.11-SNAPSHOT.jar:1.11-SNAPSHOT]
> at org.apache.calcite.runtime.Resources$ExInst.ex(Resources.java:550)
> ~[flink-table_2.11-1.11-SNAPSHOT.jar:1.11-SNAPSHOT]
> at org.apache.calcite.sql.SqlUtil.newContextException(SqlUtil.java:839)
> ~[flink-table_2.11-1.11-SNAPSHOT.jar:1.11-SNAPSHOT]
> at org.apache.calcite.sql.SqlUtil.newContextException(SqlUtil.java:824)
> ~[flink-table_2.11-1.11-SNAPSHOT.jar:1.11-SNAPSHOT]
> at org.apache.calcite.sql.validate.SqlValidatorImpl.newValidationError(SqlValidatorImpl.java:5089)
> ~[flink-table_2.11-1.11-SNAPSHOT.jar:1.11-SNAPSHOT]
> at org.apache.calcite.sql.validate.DelegatingScope.fullyQualify(DelegatingScope.java:259)
> ~[flink-table_2.11-1.11-SNAPSHOT.jar:1.11-SNAPSHOT]
> at org.apache.calcite.sql.validate.SqlValidatorImpl$DeriveTypeVisitor.visit(SqlValidatorImpl.java:5882)
> ~[flink-table_2.11-1.11-SNAPSHOT.jar:1.11-SNAPSHOT]
> at org.apache.calcite.sql.validate.SqlValidatorImpl$DeriveTypeVisitor.visit(SqlValidatorImpl.java:5845)
> ~[flink-table_2.11-1.11-SNAPSHOT.jar:1.11-SNAPSHOT]
> at org.apache.calcite.sql.SqlIdentifier.accept(SqlIdentifier.java:321)
> ~[flink-table_2.11-1.11-SNAPSHOT.jar:1.11-SNAPSHOT]
> at org.apache.calcite.sql.validate.SqlValidatorImpl.deriveTypeImpl(SqlValidatorImpl.java:1800)
> ~[flink-table_2.11-1.11-SNAPSHOT.jar:1.11-SNAPSHOT]
> at org.apache.calcite.sql.validate.SqlValidatorImpl.deriveType(SqlValidatorImpl.java:1785)
> ~[flink-table_2.11-1.11-SNAPSHOT.jar:1.11-SNAPSHOT]
> at org.apache.calcite.sql.SqlCallBinding.getOperandType(SqlCallBinding.java:237)
> ~[flink-table_2.11-1.11-SNAPSHOT.jar:1.11-SNAPSHOT]
> at org.apache.flink.table.planner.functions.utils.UserDefinedFunctionUtils$$anonfun$12.apply(UserDefinedFunctionUtils.scala:788)
> ~[flink-table-blink_2.11-1.11-SNAPSHOT.jar:1.11-SNAPSHOT]
> at org.apache.flink.table.planner.functions.utils.UserDefinedFunctionUtils$$anonfun$12.apply(UserDefinedFunctionUtils.scala:787)
> ~[flink-table-blink_2.11-1.11-SNAPSHOT.jar:1.11-SNAPSHOT]
> at scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:234)
> ~[flink-dist_2.11-1.11-SNAPSHOT.jar:1.11-SNAPSHOT]
> at scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:234)
> ~[flink-dist_2.11-1.11-SNAPSHOT.jar:1.11-SNAPSHOT]
> at scala.collection.immutable.Range.foreach(Range.scala:160)
> ~[flink-dist_2.11-1.11-SNAPSHOT.jar:1.11-SNAPSHOT]
> at scala.collection.TraversableLike$class.map(TraversableLike.scala:234)
> ~[flink-dist_2.11-1.11-SNAPSHOT.jar:1.11-SNAPSHOT]
> at scala.collection.AbstractTraversable.map(Traversable.scala:104)
> ~[flink-dist_2.11-1.11-SNAPSHOT.jar:1.11-SNAPSHOT]
> at org.apache.flink.table.planner.functions.utils.UserDefinedFunctionUtils$.getOperandType(UserDefinedFunctionUtils.scala:787)
> ~[flink-table-blink_2.11-1.11-SNAPSHOT.jar:1.11-SNAPSHOT]
> at org.apache.flink.table.planner.functions.utils.ScalarSqlFunction$.inferOperandTypes(ScalarSqlFunction.scala:116)
> ~[flink-table-blink_2.11-1.11-SNAPSHOT.jar:1.11-SNAPSHOT]
> at org.apache.flink.table.planner.functions.utils.ScalarSqlFunction$$anon$2.inferOperandTypes(ScalarSqlFunction.scala:103)
> ~[flink-table-blink_2.11-1.11-SNAPSHOT.jar:1.11-SNAPSHOT]
> at org.apache.calcite.sql.validate.SqlValidatorImpl.inferUnknownTypes(SqlValidatorImpl.java:1980)
> ~[flink-table_2.11-1.11-SNAPSHOT.jar:1.11-SNAPSHOT]
> at org.apache.calcite.sql.validate.SqlValidatorImpl.inferUnknownTypes(SqlValidatorImpl.java:1988)
> ~[flink-table_2.11-1.11-SNAPSHOT.jar:1.11-SNAPSHOT]
> at org.apache.calcite.sql.validate.SqlValidatorImpl.inferUnknownTypes(SqlValidatorImpl.java:1951)
> ~[flink-table_2.11-1.11-SNAPSHOT.jar:1.11-SNAPSHOT]
> at org.apache.calcite.sql.validate.SqlValidatorImpl.inferUnknownTypes(SqlValidatorImpl.java:1988)
> ~[flink-table_2.11-1.11-SNAPSHOT.jar:1.11-SNAPSHOT]
> at org.apache.calcite.sql.validate.ProcedureNamespace.validateImpl(ProcedureNamespace.java:56)
> ~[flink-table_2.11-1.11-SNAPSHOT.jar:1.11-SNAPSHOT]
> at org.apache.calcite.sql.validate.AbstractNamespace.validate(AbstractNamespace.java:84)
> ~[flink-table_2.11-1.11-SNAPSHOT.jar:1.11-SNAPSHOT]
> at org.apache.calcite.sql.validate.SqlValidatorImpl.validateNamespace(SqlValidatorImpl.java:1110)
> ~[flink-table_2.11-1.11-SNAPSHOT.jar:1.11-SNAPSHOT]
> at org.apache.calcite.sql.validate.SqlValidatorImpl.validateQuery(SqlValidatorImpl.java:1084)
> ~[flink-table_2.11-1.11-SNAPSHOT.jar:1.11-SNAPSHOT]
> at org.apache.calcite.sql.validate.SqlValidatorImpl.validateFrom(SqlValidatorImpl.java:3256)
> ~[flink-table_2.11-1.11-SNAPSHOT.jar:1.11-SNAPSHOT]
> at org.apache.calcite.sql.validate.SqlValidatorImpl.validateFrom(SqlValidatorImpl.java:3238)
> ~[flink-table_2.11-1.11-SNAPSHOT.jar:1.11-SNAPSHOT]
> at org.apache.calcite.sql.validate.SqlValidatorImpl.validateJoin(SqlValidatorImpl.java:3303)
> ~[flink-table_2.11-1.11-SNAPSHOT.jar:1.11-SNAPSHOT]
> at org.apache.flink.table.planner.calcite.FlinkCalciteSqlValidator.validateJoin(FlinkCalciteSqlValidator.java:86)
> ~[flink-table-blink_2.11-1.11-SNAPSHOT.jar:1.11-SNAPSHOT]
> at org.apache.calcite.sql.validate.SqlValidatorImpl.validateFrom(SqlValidatorImpl.java:3247)
> ~[flink-table_2.11-1.11-SNAPSHOT.jar:1.11-SNAPSHOT]
> at org.apache.calcite.sql.validate.SqlValidatorImpl.validateSelect(SqlValidatorImpl.java:3510)
> ~[flink-table_2.11-1.11-SNAPSHOT.jar:1.11-SNAPSHOT]
> at org.apache.calcite.sql.validate.SelectNamespace.validateImpl(SelectNamespace.java:60)
> ~[flink-table_2.11-1.11-SNAPSHOT.jar:1.11-SNAPSHOT]
> at org.apache.calcite.sql.validate.AbstractNamespace.validate(AbstractNamespace.java:84)
> ~[flink-table_2.11-1.11-SNAPSHOT.jar:1.11-SNAPSHOT]
> at org.apache.calcite.sql.validate.SqlValidatorImpl.validateNamespace(SqlValidatorImpl.java:1110)
> ~[flink-table_2.11-1.11-SNAPSHOT.jar:1.11-SNAPSHOT]
> at org.apache.calcite.sql.validate.SqlValidatorImpl.validateQuery(SqlValidatorImpl.java:1084)
> ~[flink-table_2.11-1.11-SNAPSHOT.jar:1.11-SNAPSHOT]
> at org.apache.calcite.sql.SqlSelect.validate(SqlSelect.java:232)
> ~[flink-table_2.11-1.11-SNAPSHOT.jar:1.11-SNAPSHOT]
> at org.apache.calcite.sql.validate.SqlValidatorImpl.validateScopedExpression(SqlValidatorImpl.java:1059)
> ~[flink-table_2.11-1.11-SNAPSHOT.jar:1.11-SNAPSHOT]
> at org.apache.calcite.sql.validate.SqlValidatorImpl.validate(SqlValidatorImpl.java:766)
> ~[flink-table_2.11-1.11-SNAPSHOT.jar:1.11-SNAPSHOT]
> at org.apache.flink.table.planner.calcite.FlinkPlannerImpl.org$apache$flink$table$planner$calcite$FlinkPlannerImpl$$validate(FlinkPlannerImpl.scala:141)
> ~[flink-table-blink_2.11-1.11-SNAPSHOT.jar:1.11-SNAPSHOT]
> at org.apache.flink.table.planner.calcite.FlinkPlannerImpl$ToRelContextImpl.expandView(FlinkPlannerImpl.scala:204)
> ~[flink-table-blink_2.11-1.11-SNAPSHOT.jar:1.11-SNAPSHOT]
> at org.apache.calcite.plan.ViewExpanders$1.expandView(ViewExpanders.java:52)
> ~[flink-table_2.11-1.11-SNAPSHOT.jar:1.11-SNAPSHOT]
> at org.apache.flink.table.planner.catalog.SqlCatalogViewTable.convertToRel(SqlCatalogViewTable.java:58)
> ~[flink-table-blink_2.11-1.11-SNAPSHOT.jar:1.11-SNAPSHOT]
> at org.apache.flink.table.planner.plan.schema.ExpandingPreparingTable.expand(ExpandingPreparingTable.java:59)
> ~[flink-table-blink_2.11-1.11-SNAPSHOT.jar:1.11-SNAPSHOT]
> at org.apache.flink.table.planner.plan.schema.ExpandingPreparingTable.toRel(ExpandingPreparingTable.java:55)
> ~[flink-table-blink_2.11-1.11-SNAPSHOT.jar:1.11-SNAPSHOT]
> at org.apache.calcite.sql2rel.SqlToRelConverter.toRel(SqlToRelConverter.java:3492)
> ~[flink-table_2.11-1.11-SNAPSHOT.jar:1.11-SNAPSHOT]
> at org.apache.calcite.sql2rel.SqlToRelConverter.convertIdentifier(SqlToRelConverter.java:2415)
> ~[flink-table_2.11-1.11-SNAPSHOT.jar:1.11-SNAPSHOT]
> at org.apache.calcite.sql2rel.SqlToRelConverter.convertFrom(SqlToRelConverter.java:2102)
> ~[flink-table_2.11-1.11-SNAPSHOT.jar:1.11-SNAPSHOT]
> at org.apache.calcite.sql2rel.SqlToRelConverter.convertFrom(SqlToRelConverter.java:2051)
> ~[flink-table_2.11-1.11-SNAPSHOT.jar:1.11-SNAPSHOT]
> at org.apache.calcite.sql2rel.SqlToRelConverter.convertSelectImpl(SqlToRelConverter.java:661)
> ~[flink-table_2.11-1.11-SNAPSHOT.jar:1.11-SNAPSHOT]
> at org.apache.calcite.sql2rel.SqlToRelConverter.convertSelect(SqlToRelConverter.java:642)
> ~[flink-table_2.11-1.11-SNAPSHOT.jar:1.11-SNAPSHOT]
> at org.apache.calcite.sql2rel.SqlToRelConverter.convertQueryRecursive(SqlToRelConverter.java:3345)
> ~[flink-table_2.11-1.11-SNAPSHOT.jar:1.11-SNAPSHOT]
> at org.apache.calcite.sql2rel.SqlToRelConverter.convertQuery(SqlToRelConverter.java:568)
> ~[flink-table_2.11-1.11-SNAPSHOT.jar:1.11-SNAPSHOT]
> at org.apache.flink.table.planner.calcite.FlinkPlannerImpl.org$apache$flink$table$planner$calcite$FlinkPlannerImpl$$rel(FlinkPlannerImpl.scala:164)
> ~[flink-table-blink_2.11-1.11-SNAPSHOT.jar:1.11-SNAPSHOT]
> at org.apache.flink.table.planner.calcite.FlinkPlannerImpl.rel(FlinkPlannerImpl.scala:151)
> ~[flink-table-blink_2.11-1.11-SNAPSHOT.jar:1.11-SNAPSHOT]
> at org.apache.flink.table.planner.operations.SqlToOperationConverter.toQueryOperation(SqlToOperationConverter.java:774)
> ~[flink-table-blink_2.11-1.11-SNAPSHOT.jar:1.11-SNAPSHOT]
> at org.apache.flink.table.planner.operations.SqlToOperationConverter.convertSqlQuery(SqlToOperationConverter.java:746)
> ~[flink-table-blink_2.11-1.11-SNAPSHOT.jar:1.11-SNAPSHOT]
> at org.apache.flink.table.planner.operations.SqlToOperationConverter.convert(SqlToOperationConverter.java:236)
> ~[flink-table-blink_2.11-1.11-SNAPSHOT.jar:1.11-SNAPSHOT]
> at org.apache.flink.table.planner.delegation.ParserImpl.parse(ParserImpl.java:78)
> ~[flink-table-blink_2.11-1.11-SNAPSHOT.jar:1.11-SNAPSHOT]
> at org.apache.flink.table.client.gateway.local.LocalExecutor$1.lambda$parse$0(LocalExecutor.java:430)
> ~[flink-sql-client_2.11-1.11-SNAPSHOT.jar:1.11-SNAPSHOT]
> at org.apache.flink.table.client.gateway.local.ExecutionContext.wrapClassLoader(ExecutionContext.java:255)
> ~[flink-sql-client_2.11-1.11-SNAPSHOT.jar:1.11-SNAPSHOT]
> at org.apache.flink.table.client.gateway.local.LocalExecutor$1.parse(LocalExecutor.java:430)
> ~[flink-sql-client_2.11-1.11-SNAPSHOT.jar:1.11-SNAPSHOT]
> at org.apache.flink.table.client.cli.SqlCommandParser.parseBySqlParser(SqlCommandParser.java:97)
> ~[flink-sql-client_2.11-1.11-SNAPSHOT.jar:1.11-SNAPSHOT]
Reply | Threaded
Open this post in threaded view
|

Re: flink sql多层view嵌套,字段not found

Leonard Xu
In reply to this post by Lin Hou
Hi, linhou

使用方式没问题,这个看起来像是个bug, 你可以去社区[1]建一个issue, issue上贴个可以复现这个问题的demo

Best
Leonard
[1] https://issues.apache.org/jira/projects/FLINK/summary <https://issues.apache.org/jira/projects/FLINK/summary>

> 在 2020年9月3日,18:40,Lin Hou <[hidden email]> 写道:
>
>  activity_property