[jira] [Updated] (FLINK-5750) Incorrect translation of n-ary Union

2018-07-24 Thread Chesnay Schepler (JIRA)


 [ 
https://issues.apache.org/jira/browse/FLINK-5750?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Chesnay Schepler updated FLINK-5750:

Fix Version/s: (was: 1.5.2)
   1.5.3

> Incorrect translation of n-ary Union
> 
>
> Key: FLINK-5750
> URL: https://issues.apache.org/jira/browse/FLINK-5750
> Project: Flink
>  Issue Type: Bug
>  Components: Table API  SQL
>Affects Versions: 1.2.0, 1.3.4, 1.5.0, 1.4.2, 1.6.0
>Reporter: Anton Mushin
>Assignee: Alexander Koltsov
>Priority: Critical
>  Labels: pull-request-available
> Fix For: 1.4.3, 1.6.0, 1.5.3, 1.7.0
>
>
> Calcite's union operator is supports more than two input relations. However, 
> Flink's translation rules only consider the first two relations because we 
> assumed that Calcite's union is binary. 
> This problem exists for batch and streaming queries.
> It seems that Calcite only generates non-binary Unions in rare cases 
> ({{(SELECT * FROM t) UNION ALL (SELECT * FROM t) UNION ALL (SELECT * FROM 
> t)}} results in two binary union operators) but the problem definitely needs 
> to be fixed.
> The following query can be used to validate the problem. 
> {code:java}
> @Test
>   public void testValuesWithCast() throws Exception {
>   ExecutionEnvironment env = 
> ExecutionEnvironment.getExecutionEnvironment();
>   BatchTableEnvironment tableEnv = 
> TableEnvironment.getTableEnvironment(env, config());
>   String sqlQuery = "VALUES (1, cast(1 as BIGINT) )," +
>   "(2, cast(2 as BIGINT))," +
>   "(3, cast(3 as BIGINT))";
>   String sqlQuery2 = "VALUES (1,1)," +
>   "(2, 2)," +
>   "(3, 3)";
>   Table result = tableEnv.sql(sqlQuery);
>   DataSet resultSet = tableEnv.toDataSet(result, Row.class);
>   List results = resultSet.collect();
>   Table result2 = tableEnv.sql(sqlQuery2);
>   DataSet resultSet2 = tableEnv.toDataSet(result2, 
> Row.class);
>   List results2 = resultSet2.collect();
>   String expected = "1,1\n2,2\n3,3";
>   compareResultAsText(results2, expected);
>   compareResultAsText(results, expected);
>   }
> {code}
> AR for {{results}} variable
> {noformat}
> java.lang.AssertionError: Different elements in arrays: expected 3 elements 
> and received 2
>  expected: [1,1, 2,2, 3,3]
>  received: [1,1, 2,2] 
> Expected :3
> Actual   :2
> {noformat}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Updated] (FLINK-5750) Incorrect translation of n-ary Union

2018-07-05 Thread Fabian Hueske (JIRA)


 [ 
https://issues.apache.org/jira/browse/FLINK-5750?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Fabian Hueske updated FLINK-5750:
-
Description: 
Calcite's union operator is supports more than two input relations. However, 
Flink's translation rules only consider the first two relations because we 
assumed that Calcite's union is binary. 
This problem exists for batch and streaming queries.

It seems that Calcite only generates non-binary Unions in rare cases ({{(SELECT 
* FROM t) UNION ALL (SELECT * FROM t) UNION ALL (SELECT * FROM t)}} results in 
two binary union operators) but the problem definitely needs to be fixed.

The following query can be used to validate the problem. 

{code:java}
@Test
public void testValuesWithCast() throws Exception {
ExecutionEnvironment env = 
ExecutionEnvironment.getExecutionEnvironment();
BatchTableEnvironment tableEnv = 
TableEnvironment.getTableEnvironment(env, config());

String sqlQuery = "VALUES (1, cast(1 as BIGINT) )," +
"(2, cast(2 as BIGINT))," +
"(3, cast(3 as BIGINT))";
String sqlQuery2 = "VALUES (1,1)," +
"(2, 2)," +
"(3, 3)";
Table result = tableEnv.sql(sqlQuery);
DataSet resultSet = tableEnv.toDataSet(result, Row.class);
List results = resultSet.collect();

Table result2 = tableEnv.sql(sqlQuery2);
DataSet resultSet2 = tableEnv.toDataSet(result2, 
Row.class);
List results2 = resultSet2.collect();

String expected = "1,1\n2,2\n3,3";
compareResultAsText(results2, expected);
compareResultAsText(results, expected);
}
{code}

AR for {{results}} variable
{noformat}
java.lang.AssertionError: Different elements in arrays: expected 3 elements and 
received 2
 expected: [1,1, 2,2, 3,3]
 received: [1,1, 2,2] 
Expected :3
Actual   :2
{noformat}



  was:
Calcite's union operator is supports more than two input relations. However, 
Flink's translation rules only consider the first two relations because we 
assumed that Calcite's union is binary. 
This problem exists for batch and streaming queries.

The following query can be used to validate the problem. 

{code:java}
@Test
public void testValuesWithCast() throws Exception {
ExecutionEnvironment env = 
ExecutionEnvironment.getExecutionEnvironment();
BatchTableEnvironment tableEnv = 
TableEnvironment.getTableEnvironment(env, config());

String sqlQuery = "VALUES (1, cast(1 as BIGINT) )," +
"(2, cast(2 as BIGINT))," +
"(3, cast(3 as BIGINT))";
String sqlQuery2 = "VALUES (1,1)," +
"(2, 2)," +
"(3, 3)";
Table result = tableEnv.sql(sqlQuery);
DataSet resultSet = tableEnv.toDataSet(result, Row.class);
List results = resultSet.collect();

Table result2 = tableEnv.sql(sqlQuery2);
DataSet resultSet2 = tableEnv.toDataSet(result2, 
Row.class);
List results2 = resultSet2.collect();

String expected = "1,1\n2,2\n3,3";
compareResultAsText(results2, expected);
compareResultAsText(results, expected);
}
{code}

AR for {{results}} variable
{noformat}
java.lang.AssertionError: Different elements in arrays: expected 3 elements and 
received 2
 expected: [1,1, 2,2, 3,3]
 received: [1,1, 2,2] 
Expected :3
Actual   :2
{noformat}


> Incorrect translation of n-ary Union
> 
>
> Key: FLINK-5750
> URL: https://issues.apache.org/jira/browse/FLINK-5750
> Project: Flink
>  Issue Type: Bug
>  Components: Table API  SQL
>Affects Versions: 1.2.0, 1.3.4, 1.5.0, 1.4.2, 1.6.0
>Reporter: Anton Mushin
>Assignee: Alexander Koltsov
>Priority: Critical
>  Labels: pull-request-available
>
> Calcite's union operator is supports more than two input relations. However, 
> Flink's translation rules only consider the first two relations because we 
> assumed that Calcite's union is binary. 
> This problem exists for batch and streaming queries.
> It seems that Calcite only generates non-binary Unions in rare cases 
> ({{(SELECT * FROM t) UNION ALL (SELECT * FROM t) UNION ALL (SELECT * FROM 
> t)}} results in two binary union operators) but the problem definitely needs 
> to be fixed.
> The following query can be used to validate the problem. 
> {code:java}
> @Test
>   public void testValuesWithCast() throws Exception {
>   ExecutionEnvironment env = 
> ExecutionEnvironment.getExecutionEnvironment();
> 

[jira] [Updated] (FLINK-5750) Incorrect translation of n-ary Union

2018-07-05 Thread Fabian Hueske (JIRA)


 [ 
https://issues.apache.org/jira/browse/FLINK-5750?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Fabian Hueske updated FLINK-5750:
-
Description: 
Calcite's union operator is supports more than two input relations. However, 
Flink's translation rules only consider the first two relations because we 
assumed that Calcite's union is binary. 
This problem exists for batch and streaming queries.

The following query can be used to validate the problem. 

{code:java}
@Test
public void testValuesWithCast() throws Exception {
ExecutionEnvironment env = 
ExecutionEnvironment.getExecutionEnvironment();
BatchTableEnvironment tableEnv = 
TableEnvironment.getTableEnvironment(env, config());

String sqlQuery = "VALUES (1, cast(1 as BIGINT) )," +
"(2, cast(2 as BIGINT))," +
"(3, cast(3 as BIGINT))";
String sqlQuery2 = "VALUES (1,1)," +
"(2, 2)," +
"(3, 3)";
Table result = tableEnv.sql(sqlQuery);
DataSet resultSet = tableEnv.toDataSet(result, Row.class);
List results = resultSet.collect();

Table result2 = tableEnv.sql(sqlQuery2);
DataSet resultSet2 = tableEnv.toDataSet(result2, 
Row.class);
List results2 = resultSet2.collect();

String expected = "1,1\n2,2\n3,3";
compareResultAsText(results2, expected);
compareResultAsText(results, expected);
}
{code}

AR for {{results}} variable
{noformat}
java.lang.AssertionError: Different elements in arrays: expected 3 elements and 
received 2
 expected: [1,1, 2,2, 3,3]
 received: [1,1, 2,2] 
Expected :3
Actual   :2
{noformat}

  was:
Calcite's union operator is supports more than two input relations. However, 
Flink's translation rules only consider the first two relations because we 
assumed that Calcite's union is binary. 
This problem exists for batch and streaming queries.

The following query can be used to validate the problem. 

{code:java}
@Test
public void testValuesWithCast() throws Exception {
ExecutionEnvironment env = 
ExecutionEnvironment.getExecutionEnvironment();
BatchTableEnvironment tableEnv = 
TableEnvironment.getTableEnvironment(env, config());

String sqlQuery = "VALUES (1, cast(1 as BIGINT) )," +
"(2, cast(2 as BIGINT))," +
"(3, cast(3 as BIGINT))";
String sqlQuery2 = "VALUES (1,1)," +
"(2, 2)," +
"(3, 3)";
Table result = tableEnv.sql(sqlQuery);
DataSet resultSet = tableEnv.toDataSet(result, Row.class);
List results = resultSet.collect();

Table result2 = tableEnv.sql(sqlQuery2);
DataSet resultSet2 = tableEnv.toDataSet(result2, 
Row.class);
List results2 = resultSet2.collect();

String expected = "1,1\n2,2\n3,3";
compareResultAsText(results2, expected);
compareResultAsText(results, expected);
}
{code}

AR for {{results}} variable
{noformat}
java.lang.AssertionError: Different elements in arrays: expected 3 elements and 
received 2
 expected: [1,1, 2,2, 3,3]
 received: [1,1, 2,2] 
Expected :3
Actual   :2
{noformat}

It seems that 


> Incorrect translation of n-ary Union
> 
>
> Key: FLINK-5750
> URL: https://issues.apache.org/jira/browse/FLINK-5750
> Project: Flink
>  Issue Type: Bug
>  Components: Table API  SQL
>Affects Versions: 1.2.0, 1.3.4, 1.5.0, 1.4.2, 1.6.0
>Reporter: Anton Mushin
>Assignee: Alexander Koltsov
>Priority: Critical
>  Labels: pull-request-available
>
> Calcite's union operator is supports more than two input relations. However, 
> Flink's translation rules only consider the first two relations because we 
> assumed that Calcite's union is binary. 
> This problem exists for batch and streaming queries.
> The following query can be used to validate the problem. 
> {code:java}
> @Test
>   public void testValuesWithCast() throws Exception {
>   ExecutionEnvironment env = 
> ExecutionEnvironment.getExecutionEnvironment();
>   BatchTableEnvironment tableEnv = 
> TableEnvironment.getTableEnvironment(env, config());
>   String sqlQuery = "VALUES (1, cast(1 as BIGINT) )," +
>   "(2, cast(2 as BIGINT))," +
>   "(3, cast(3 as BIGINT))";
>   String sqlQuery2 = "VALUES (1,1)," +
>   "(2, 2)," +
>   "(3, 3)";
>   Table result = tableEnv.sql(sqlQuery);
>   

[jira] [Updated] (FLINK-5750) Incorrect translation of n-ary Union

2018-07-05 Thread Fabian Hueske (JIRA)


 [ 
https://issues.apache.org/jira/browse/FLINK-5750?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Fabian Hueske updated FLINK-5750:
-
Description: 
Calcite's union operator is supports more than two input relations. However, 
Flink's translation rules only consider the first two relations because we 
assumed that Calcite's union is binary. 
This problem exists for batch and streaming queries.

The following query can be used to validate the problem. 

{code:java}
@Test
public void testValuesWithCast() throws Exception {
ExecutionEnvironment env = 
ExecutionEnvironment.getExecutionEnvironment();
BatchTableEnvironment tableEnv = 
TableEnvironment.getTableEnvironment(env, config());

String sqlQuery = "VALUES (1, cast(1 as BIGINT) )," +
"(2, cast(2 as BIGINT))," +
"(3, cast(3 as BIGINT))";
String sqlQuery2 = "VALUES (1,1)," +
"(2, 2)," +
"(3, 3)";
Table result = tableEnv.sql(sqlQuery);
DataSet resultSet = tableEnv.toDataSet(result, Row.class);
List results = resultSet.collect();

Table result2 = tableEnv.sql(sqlQuery2);
DataSet resultSet2 = tableEnv.toDataSet(result2, 
Row.class);
List results2 = resultSet2.collect();

String expected = "1,1\n2,2\n3,3";
compareResultAsText(results2, expected);
compareResultAsText(results, expected);
}
{code}

AR for {{results}} variable
{noformat}
java.lang.AssertionError: Different elements in arrays: expected 3 elements and 
received 2
 expected: [1,1, 2,2, 3,3]
 received: [1,1, 2,2] 
Expected :3
Actual   :2
{noformat}

It seems that 

  was:
Calcite's union operator is supports more than two input relations. However, 
Flink's translation rules only consider the first two relations because we 
assumed that Calcite's union is binary. 
This problem exists for batch and streaming queries.

The following query can be used to validate the problem. 

{code:java}
@Test
public void testValuesWithCast() throws Exception {
ExecutionEnvironment env = 
ExecutionEnvironment.getExecutionEnvironment();
BatchTableEnvironment tableEnv = 
TableEnvironment.getTableEnvironment(env, config());

String sqlQuery = "VALUES (1, cast(1 as BIGINT) )," +
"(2, cast(2 as BIGINT))," +
"(3, cast(3 as BIGINT))";
String sqlQuery2 = "VALUES (1,1)," +
"(2, 2)," +
"(3, 3)";
Table result = tableEnv.sql(sqlQuery);
DataSet resultSet = tableEnv.toDataSet(result, Row.class);
List results = resultSet.collect();

Table result2 = tableEnv.sql(sqlQuery2);
DataSet resultSet2 = tableEnv.toDataSet(result2, 
Row.class);
List results2 = resultSet2.collect();

String expected = "1,1\n2,2\n3,3";
compareResultAsText(results2, expected);
compareResultAsText(results, expected);
}
{code}
AR for {{results}} variable
{noformat}
java.lang.AssertionError: Different elements in arrays: expected 3 elements and 
received 2
 expected: [1,1, 2,2, 3,3]
 received: [1,1, 2,2] 
Expected :3
Actual   :2
{noformat}


> Incorrect translation of n-ary Union
> 
>
> Key: FLINK-5750
> URL: https://issues.apache.org/jira/browse/FLINK-5750
> Project: Flink
>  Issue Type: Bug
>  Components: Table API  SQL
>Affects Versions: 1.2.0, 1.3.4, 1.5.0, 1.4.2, 1.6.0
>Reporter: Anton Mushin
>Assignee: Alexander Koltsov
>Priority: Critical
>  Labels: pull-request-available
>
> Calcite's union operator is supports more than two input relations. However, 
> Flink's translation rules only consider the first two relations because we 
> assumed that Calcite's union is binary. 
> This problem exists for batch and streaming queries.
> The following query can be used to validate the problem. 
> {code:java}
> @Test
>   public void testValuesWithCast() throws Exception {
>   ExecutionEnvironment env = 
> ExecutionEnvironment.getExecutionEnvironment();
>   BatchTableEnvironment tableEnv = 
> TableEnvironment.getTableEnvironment(env, config());
>   String sqlQuery = "VALUES (1, cast(1 as BIGINT) )," +
>   "(2, cast(2 as BIGINT))," +
>   "(3, cast(3 as BIGINT))";
>   String sqlQuery2 = "VALUES (1,1)," +
>   "(2, 2)," +
>   "(3, 3)";
>   Table result = tableEnv.sql(sqlQuery);
>   

[jira] [Updated] (FLINK-5750) Incorrect translation of n-ary Union

2018-07-05 Thread Fabian Hueske (JIRA)


 [ 
https://issues.apache.org/jira/browse/FLINK-5750?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Fabian Hueske updated FLINK-5750:
-
Description: 
Calcite's union operator is supports more than two input relations. However, 
Flink's translation rules only consider the first two relations because we 
assumed that Calcite's union is binary. 
This problem exists for batch and streaming queries.

The following query can be used to validate the problem. 

{code:java}
@Test
public void testValuesWithCast() throws Exception {
ExecutionEnvironment env = 
ExecutionEnvironment.getExecutionEnvironment();
BatchTableEnvironment tableEnv = 
TableEnvironment.getTableEnvironment(env, config());

String sqlQuery = "VALUES (1, cast(1 as BIGINT) )," +
"(2, cast(2 as BIGINT))," +
"(3, cast(3 as BIGINT))";
String sqlQuery2 = "VALUES (1,1)," +
"(2, 2)," +
"(3, 3)";
Table result = tableEnv.sql(sqlQuery);
DataSet resultSet = tableEnv.toDataSet(result, Row.class);
List results = resultSet.collect();

Table result2 = tableEnv.sql(sqlQuery2);
DataSet resultSet2 = tableEnv.toDataSet(result2, 
Row.class);
List results2 = resultSet2.collect();

String expected = "1,1\n2,2\n3,3";
compareResultAsText(results2, expected);
compareResultAsText(results, expected);
}
{code}
AR for {{results}} variable
{noformat}
java.lang.AssertionError: Different elements in arrays: expected 3 elements and 
received 2
 expected: [1,1, 2,2, 3,3]
 received: [1,1, 2,2] 
Expected :3
Actual   :2
{noformat}

  was:
{code:java}
@Test
public void testValuesWithCast() throws Exception {
ExecutionEnvironment env = 
ExecutionEnvironment.getExecutionEnvironment();
BatchTableEnvironment tableEnv = 
TableEnvironment.getTableEnvironment(env, config());

String sqlQuery = "VALUES (1, cast(1 as BIGINT) )," +
"(2, cast(2 as BIGINT))," +
"(3, cast(3 as BIGINT))";
String sqlQuery2 = "VALUES (1,1)," +
"(2, 2)," +
"(3, 3)";
Table result = tableEnv.sql(sqlQuery);
DataSet resultSet = tableEnv.toDataSet(result, Row.class);
List results = resultSet.collect();

Table result2 = tableEnv.sql(sqlQuery2);
DataSet resultSet2 = tableEnv.toDataSet(result2, 
Row.class);
List results2 = resultSet2.collect();

String expected = "1,1\n2,2\n3,3";
compareResultAsText(results2, expected);
compareResultAsText(results, expected);
}
{code}
AR for {{results}} variable
{noformat}
java.lang.AssertionError: Different elements in arrays: expected 3 elements and 
received 2
 expected: [1,1, 2,2, 3,3]
 received: [1,1, 2,2] 
Expected :3
Actual   :2
{noformat}


> Incorrect translation of n-ary Union
> 
>
> Key: FLINK-5750
> URL: https://issues.apache.org/jira/browse/FLINK-5750
> Project: Flink
>  Issue Type: Bug
>  Components: Table API  SQL
>Affects Versions: 1.2.0, 1.3.4, 1.5.0, 1.4.2, 1.6.0
>Reporter: Anton Mushin
>Assignee: Alexander Koltsov
>Priority: Critical
>  Labels: pull-request-available
>
> Calcite's union operator is supports more than two input relations. However, 
> Flink's translation rules only consider the first two relations because we 
> assumed that Calcite's union is binary. 
> This problem exists for batch and streaming queries.
> The following query can be used to validate the problem. 
> {code:java}
> @Test
>   public void testValuesWithCast() throws Exception {
>   ExecutionEnvironment env = 
> ExecutionEnvironment.getExecutionEnvironment();
>   BatchTableEnvironment tableEnv = 
> TableEnvironment.getTableEnvironment(env, config());
>   String sqlQuery = "VALUES (1, cast(1 as BIGINT) )," +
>   "(2, cast(2 as BIGINT))," +
>   "(3, cast(3 as BIGINT))";
>   String sqlQuery2 = "VALUES (1,1)," +
>   "(2, 2)," +
>   "(3, 3)";
>   Table result = tableEnv.sql(sqlQuery);
>   DataSet resultSet = tableEnv.toDataSet(result, Row.class);
>   List results = resultSet.collect();
>   Table result2 = tableEnv.sql(sqlQuery2);
>   DataSet resultSet2 = tableEnv.toDataSet(result2, 
> Row.class);
>   List results2 = resultSet2.collect();
>   String 

[jira] [Updated] (FLINK-5750) Incorrect translation of n-ary Union

2018-07-05 Thread Fabian Hueske (JIRA)


 [ 
https://issues.apache.org/jira/browse/FLINK-5750?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Fabian Hueske updated FLINK-5750:
-
Affects Version/s: 1.6.0
   1.3.4
   1.5.0
   1.4.2

> Incorrect translation of n-ary Union
> 
>
> Key: FLINK-5750
> URL: https://issues.apache.org/jira/browse/FLINK-5750
> Project: Flink
>  Issue Type: Bug
>  Components: Table API  SQL
>Affects Versions: 1.2.0, 1.3.4, 1.5.0, 1.4.2, 1.6.0
>Reporter: Anton Mushin
>Assignee: Alexander Koltsov
>Priority: Critical
>  Labels: pull-request-available
>
> Calcite's union operator is supports more than two input relations. However, 
> Flink's translation rules only consider the first two relations because we 
> assumed that Calcite's union is binary. 
> This problem exists for batch and streaming queries.
> The following query can be used to validate the problem. 
> {code:java}
> @Test
>   public void testValuesWithCast() throws Exception {
>   ExecutionEnvironment env = 
> ExecutionEnvironment.getExecutionEnvironment();
>   BatchTableEnvironment tableEnv = 
> TableEnvironment.getTableEnvironment(env, config());
>   String sqlQuery = "VALUES (1, cast(1 as BIGINT) )," +
>   "(2, cast(2 as BIGINT))," +
>   "(3, cast(3 as BIGINT))";
>   String sqlQuery2 = "VALUES (1,1)," +
>   "(2, 2)," +
>   "(3, 3)";
>   Table result = tableEnv.sql(sqlQuery);
>   DataSet resultSet = tableEnv.toDataSet(result, Row.class);
>   List results = resultSet.collect();
>   Table result2 = tableEnv.sql(sqlQuery2);
>   DataSet resultSet2 = tableEnv.toDataSet(result2, 
> Row.class);
>   List results2 = resultSet2.collect();
>   String expected = "1,1\n2,2\n3,3";
>   compareResultAsText(results2, expected);
>   compareResultAsText(results, expected);
>   }
> {code}
> AR for {{results}} variable
> {noformat}
> java.lang.AssertionError: Different elements in arrays: expected 3 elements 
> and received 2
>  expected: [1,1, 2,2, 3,3]
>  received: [1,1, 2,2] 
> Expected :3
> Actual   :2
> {noformat}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Updated] (FLINK-5750) Incorrect translation of n-ary Union

2018-07-05 Thread Fabian Hueske (JIRA)


 [ 
https://issues.apache.org/jira/browse/FLINK-5750?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Fabian Hueske updated FLINK-5750:
-
Priority: Critical  (was: Minor)

> Incorrect translation of n-ary Union
> 
>
> Key: FLINK-5750
> URL: https://issues.apache.org/jira/browse/FLINK-5750
> Project: Flink
>  Issue Type: Bug
>  Components: Table API  SQL
>Affects Versions: 1.2.0
>Reporter: Anton Mushin
>Assignee: Alexander Koltsov
>Priority: Critical
>  Labels: pull-request-available
>
> {code:java}
> @Test
>   public void testValuesWithCast() throws Exception {
>   ExecutionEnvironment env = 
> ExecutionEnvironment.getExecutionEnvironment();
>   BatchTableEnvironment tableEnv = 
> TableEnvironment.getTableEnvironment(env, config());
>   String sqlQuery = "VALUES (1, cast(1 as BIGINT) )," +
>   "(2, cast(2 as BIGINT))," +
>   "(3, cast(3 as BIGINT))";
>   String sqlQuery2 = "VALUES (1,1)," +
>   "(2, 2)," +
>   "(3, 3)";
>   Table result = tableEnv.sql(sqlQuery);
>   DataSet resultSet = tableEnv.toDataSet(result, Row.class);
>   List results = resultSet.collect();
>   Table result2 = tableEnv.sql(sqlQuery2);
>   DataSet resultSet2 = tableEnv.toDataSet(result2, 
> Row.class);
>   List results2 = resultSet2.collect();
>   String expected = "1,1\n2,2\n3,3";
>   compareResultAsText(results2, expected);
>   compareResultAsText(results, expected);
>   }
> {code}
> AR for {{results}} variable
> {noformat}
> java.lang.AssertionError: Different elements in arrays: expected 3 elements 
> and received 2
>  expected: [1,1, 2,2, 3,3]
>  received: [1,1, 2,2] 
> Expected :3
> Actual   :2
> {noformat}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Updated] (FLINK-5750) Incorrect translation of n-ary Union

2018-07-05 Thread Fabian Hueske (JIRA)


 [ 
https://issues.apache.org/jira/browse/FLINK-5750?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Fabian Hueske updated FLINK-5750:
-
Summary: Incorrect translation of n-ary Union  (was: Incorrect parse of 
brackets inside VALUES subquery)

> Incorrect translation of n-ary Union
> 
>
> Key: FLINK-5750
> URL: https://issues.apache.org/jira/browse/FLINK-5750
> Project: Flink
>  Issue Type: Bug
>  Components: Table API  SQL
>Affects Versions: 1.2.0
>Reporter: Anton Mushin
>Assignee: Alexander Koltsov
>Priority: Minor
>  Labels: pull-request-available
>
> {code:java}
> @Test
>   public void testValuesWithCast() throws Exception {
>   ExecutionEnvironment env = 
> ExecutionEnvironment.getExecutionEnvironment();
>   BatchTableEnvironment tableEnv = 
> TableEnvironment.getTableEnvironment(env, config());
>   String sqlQuery = "VALUES (1, cast(1 as BIGINT) )," +
>   "(2, cast(2 as BIGINT))," +
>   "(3, cast(3 as BIGINT))";
>   String sqlQuery2 = "VALUES (1,1)," +
>   "(2, 2)," +
>   "(3, 3)";
>   Table result = tableEnv.sql(sqlQuery);
>   DataSet resultSet = tableEnv.toDataSet(result, Row.class);
>   List results = resultSet.collect();
>   Table result2 = tableEnv.sql(sqlQuery2);
>   DataSet resultSet2 = tableEnv.toDataSet(result2, 
> Row.class);
>   List results2 = resultSet2.collect();
>   String expected = "1,1\n2,2\n3,3";
>   compareResultAsText(results2, expected);
>   compareResultAsText(results, expected);
>   }
> {code}
> AR for {{results}} variable
> {noformat}
> java.lang.AssertionError: Different elements in arrays: expected 3 elements 
> and received 2
>  expected: [1,1, 2,2, 3,3]
>  received: [1,1, 2,2] 
> Expected :3
> Actual   :2
> {noformat}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)