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

dalongliu commented on FLINK-29090:
-----------------------------------

I didn't reproduce the exception through the following sql case:

```java
@Test
publicvoidtestMap() throws Exception {
super.tableEnv()
.executeSql(
String.format(
"create table parquet_source (\n"
+ "f1 int,\n"
+ " f_map map<varchar(20), int>\n"
+ ") with (\n"
+ " 'connector' = 'filesystem',\n"
+ " 'path' = '%s',\n"
+ " 'format' = 'parquet'\n"
+ ");",
super.resultPath()));

super.tableEnv().executeSql("insert into parquet_source select 1, map['k1', 
1]").await();

List<Row> results =
CollectionUtil.iteratorToList(
super.tableEnv()
.executeSql("select f1, f_map['k1'] from parquet_source")
.collect());
assertThat(results.size()).isEqualTo(1);
}
```

> Fix the code gen for ColumnarMapData and ColumnarArrayData
> ----------------------------------------------------------
>
>                 Key: FLINK-29090
>                 URL: https://issues.apache.org/jira/browse/FLINK-29090
>             Project: Flink
>          Issue Type: Bug
>          Components: Table SQL / Runtime
>    Affects Versions: 1.16.0
>            Reporter: Danny Chen
>            Priority: Major
>             Fix For: 1.16.0
>
>         Attachments: image-2022-08-24-10-15-11-824.png
>
>
> !image-2022-08-24-10-15-11-824.png|width=589,height=284!
> Currently, the code generation for {{MapData}} assumes that it is the 
> {{{}GenericMapData{}}}, but the new introduced {{ColumnarMapData}} and 
> {{ColumnarArrayData}} can not be casted to {{{}GenericMapData{}}}.
> {{ColumnarMapData}} and {{ColumnarArrayData}} are introduced in
> FLINK-24614 
> [https://github.com/apache/flink/commit/5c731a37e1a8f71f9c9e813f6c741a1e203fa1a3]
> How to reproduce:
> {code:sql}
> create table parquet_source (
>   f_map map<varchar(20), int>
> ) with (
>   'connector' = 'filesystem',
>   'format' = 'parquet'
> );
> select f_map['k1'] from table parquet_source;
> {code}



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to