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

Xin Chen commented on FLINK-32188:
----------------------------------

Jark Wu Thank you for your reply!So should I submit a PR about this in 
github?Or the better way to fix this?

When I fix the issue through the method I introduced above,and url is defined 
as an array,I can obtain predicates successfully.
But I found another issue in my debugging process at the same time,when url is 
defined as string not an array,sql like this returned no results:
{code:java}
String s1_and = "select * from image_source " +
                "where url = 'aaa.jpg'" +
                "and url = 'bbb.jpg'";
{code}
This is because ‘url‘ cannot be assigned two different values simultaneously. I 
think this is logical. But when I defined it as an array type, sql like this 
returned two records unexpectedly! 

{code:java}
String s3_and = "select image, errorCode from image_source where " +
                "url = ARRAY['aaa.jpg', 'bbb.jpg'] and url = ARRAY['ccc.jpg', 
'ddd.jpg']";
{code}
 I debugged and found that the task has entered the 
*PushFilterIntoTableSourceScanRule *of org. apache. Flink. table. planner. 
plan. rules. logical, but when url is a string,the task of “url = xxx and url = 
yyy” didn't enter 'onMatch' method of *PushFilterIntoTableSourceScanRule*. 

 !screenshot-8.png! 
{code:java}
// filter:
rel#100:LogicalFilter.NONE.any.None: 
0.[NONE].[NONE](input=HepRelVertex#99,condition=
AND(=($0, CAST(ARRAY(_UTF-16LE'aaa.jpg', 
_UTF-16LE'bbb.jpg')):VARCHAR(2147483647) CHARACTER SET "UTF-16LE" ARRAY NOT 
NULL), 
=($0, CAST(ARRAY(_UTF-16LE'ccc.jpg', _UTF-16LE'ddd.jpg')):VARCHAR(2147483647) 
CHARACTER SET "UTF-16LE" ARRAY NOT NULL)))
{code}

I am confused how the frame work to verify that a field cannot be equal to two 
values at the same time. In which module is this processed?I think it need to 
be fixed.

> Does the custom connector not support pushing down "where" query predicates 
> to query fields of array type?
> ----------------------------------------------------------------------------------------------------------
>
>                 Key: FLINK-32188
>                 URL: https://issues.apache.org/jira/browse/FLINK-32188
>             Project: Flink
>          Issue Type: Bug
>          Components: Table SQL / Planner
>    Affects Versions: 1.12.2, 1.17.0, 1.16.1
>            Reporter: Xin Chen
>            Priority: Major
>         Attachments: image-2023-05-25-17-16-02-288.png, 
> image-2023-05-25-20-44-08-834.png, image-2023-05-25-20-44-47-581.png, 
> screenshot-1.png, screenshot-2.png, screenshot-3.png, screenshot-4.png, 
> screenshot-5.png, screenshot-6.png, screenshot-7.png, screenshot-8.png
>
>
> When I customized a data source connector which assumed as image-connector, I 
> found that when creating a table with ddl, I specified a field URL as an 
> array type. When submitting an SQL task with Flink, I specified query this 
> field as a fixed array. For example, select * from image source where 
> URL=ARRAY ['/flink. jpg', '/flink_1. jpg'], but it couldn't obtain the 
> corresponding predicate filters at all.
> Does the custom connector not support  to query fields of array type with 
> "where"?



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

Reply via email to