You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by "Timo Walther (JIRA)" <ji...@apache.org> on 2016/08/11 10:30:20 UTC
[jira] [Resolved] (FLINK-4270) 'as' in front of join does not work
[ https://issues.apache.org/jira/browse/FLINK-4270?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Timo Walther resolved FLINK-4270.
---------------------------------
Resolution: Fixed
Fix Version/s: 1.2.0
Fixed in c2a4043861c7595ee9d24bdce4a3236735af9bd9.
> 'as' in front of join does not work
> -----------------------------------
>
> Key: FLINK-4270
> URL: https://issues.apache.org/jira/browse/FLINK-4270
> Project: Flink
> Issue Type: Bug
> Components: Table API & SQL
> Reporter: Timo Walther
> Assignee: Jark Wu
> Fix For: 1.2.0
>
>
> The following example passes the validation but fails during toRexNode phase:
> {code}
> val customers = getCustomerDataSet(env).toTable(tEnv)
> .as('id, 'mktSegment)
> val orders = getOrdersDataSet(env).toTable(tEnv)
> .as('orderId, 'custId, 'orderDate, 'shipPrio)
> val items =
> orders.join(customers)
> .where('custId === 'id)
> items.printOnTaskManager("ok")
> {code}
> Leads to
> {code}
> Exception in thread "main" java.lang.IllegalArgumentException: field [custId] not found; input fields are: [id, mktSegment, id0, mktSegment0]
> at org.apache.calcite.tools.RelBuilder.field(RelBuilder.java:299)
> at org.apache.calcite.tools.RelBuilder.field(RelBuilder.java:284)
> at org.apache.flink.api.table.expressions.ResolvedFieldReference.toRexNode(fieldExpression.scala:59)
> at org.apache.flink.api.table.expressions.BinaryComparison$$anonfun$toRexNode$1.apply(comparison.scala:34)
> at org.apache.flink.api.table.expressions.BinaryComparison$$anonfun$toRexNode$1.apply(comparison.scala:34)
> at scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:244)
> at scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:244)
> at scala.collection.immutable.List.foreach(List.scala:318)
> at scala.collection.TraversableLike$class.map(TraversableLike.scala:244)
> at scala.collection.AbstractTraversable.map(Traversable.scala:105)
> at org.apache.flink.api.table.expressions.BinaryComparison.toRexNode(comparison.scala:34)
> at org.apache.flink.api.table.plan.logical.Filter.construct(operators.scala:158)
> at org.apache.flink.api.table.plan.logical.LogicalNode.toRelNode(LogicalNode.scala:78)
> at org.apache.flink.api.table.Table.getRelNode(table.scala:66)
> at org.apache.flink.api.table.BatchTableEnvironment.translate(BatchTableEnvironment.scala:243)
> at org.apache.flink.api.scala.table.BatchTableEnvironment.toDataSet(BatchTableEnvironment.scala:139)
> at org.apache.flink.api.scala.table.package$.table2RowDataSet(package.scala:77)
> at org.apache.flink.examples.scala.TPCHQuery3Table$.main(TPCHQuery3Table.scala:119)
> at org.apache.flink.examples.scala.TPCHQuery3Table.main(TPCHQuery3Table.scala)
> {code}
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)