You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by "ASF GitHub Bot (JIRA)" <ji...@apache.org> on 2018/07/05 13:20:00 UTC

[jira] [Commented] (FLINK-5750) Incorrect parse of brackets inside VALUES subquery

    [ https://issues.apache.org/jira/browse/FLINK-5750?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16533634#comment-16533634 ] 

ASF GitHub Bot commented on FLINK-5750:
---------------------------------------

GitHub user AlexanderKoltsov opened a pull request:

    https://github.com/apache/flink/pull/6267

    [FLINK-5750] Incorrect parse of brackets inside VALUES subquery

    ## What is the purpose of the change
    
    *This pull request adds supporting multiple inputs in DataSetUnionRule*
    
    
    ## Brief change log
    
      - *DataSetUnionRule should consider all inputs instead of only the 1st and 2nd*
    
    
    ## Verifying this change
    
    *This change added the following test:*
    *- Added unit test testValuesWithCast that validates VALUES operator with values which have to to be casted. This query will be transform to UNION of VALUES in plan optimizer since values arguments are not literal value*
    
    ## Does this pull request potentially affect one of the following parts:
    
      - Dependencies (does it add or upgrade a dependency): (yes / **no**)
      - The public API, i.e., is any changed class annotated with `@Public(Evolving)`: (yes / **no**)
      - The serializers: (yes / **no** / don't know)
      - The runtime per-record code paths (performance sensitive): (yes / **no** / don't know)
      - Anything that affects deployment or recovery: JobManager (and its components), Checkpointing, Yarn/Mesos, ZooKeeper: (yes / **no** / don't know)
      - The S3 file system connector: (yes / **no** / don't know)
    
    ## Documentation
    
      - Does this pull request introduce a new feature? (yes / **no**)
      - If yes, how is the feature documented? (not applicable / docs / JavaDocs / not documented)

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/AlexanderKoltsov/flink master

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/flink/pull/6267.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #6267
    
----
commit 6e0448b4039c577b017dd3bf2b09e68e0b53969f
Author: Alexander Koltsov <al...@...>
Date:   2018-07-05T09:39:40Z

    [FLINK-5750] Incorrect parse of brackets inside VALUES subquery
    
    DataSetUnionRule should consider all inputs instead of only the 1st and 2nd.

----


> Incorrect parse of brackets inside VALUES subquery
> --------------------------------------------------
>
>                 Key: FLINK-5750
>                 URL: https://issues.apache.org/jira/browse/FLINK-5750
>             Project: Flink
>          Issue Type: Bug
>          Components: Table API &amp; 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<Row> resultSet = tableEnv.toDataSet(result, Row.class);
> 		List<Row> results = resultSet.collect();
> 		Table result2 = tableEnv.sql(sqlQuery2);
> 		DataSet<Row> resultSet2 = tableEnv.toDataSet(result2, Row.class);
> 		List<Row> 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)