Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PROCTIME()类型的字段血缘关系解析错误 #38

Closed
Mlove9527 opened this issue Mar 10, 2023 · 2 comments
Closed

PROCTIME()类型的字段血缘关系解析错误 #38

Mlove9527 opened this issue Mar 10, 2023 · 2 comments
Labels
bug Something isn't working

Comments

@Mlove9527
Copy link

最好将PROCTIME()类型的字段放到最后,不要放到第一个

@HamaWhiteGG
Copy link
Owner

The solution of PROCTIME() is the same as LOCALTIMESTAMP, it is enhanced in the getColumnOrigins(Calc rel...) method. LOCALTIMESTAMP has been processed, so the lineage of PROCTIME() can be directly parsed out.

But when PROCTIME() is the first field, the obtained blood relationship will be confused. Therefore, add the computeIndexWithOffset method to calculate the correct source table number RelMdColumnOrigins , and this method is called by RelMdColumnOrigins.getColumnOrigins(Calc, RelMetadataQuery, int)

@HamaWhiteGG
Copy link
Owner

test case:
"CREATE TABLE ST (\n"
+" make_time as PROCTIME(),\n "
+ " a STRING,\n"
+ " b STRING\n"
+ ") WITH (\n"
+ " 'connector' = 'kafka',\n" +
" 'topic' = 'user_behavior',\n" +
" 'properties.bootstrap.servers' = '192.168.24.129:9092',\n" +
" 'properties.group.id' = 'testGroup',\n" +
" 'scan.startup.mode' = 'earliest-offset',\n" +
" 'format' = 'json'"
+ ");\n"
+ "CREATE TABLE TT (\n"
+ " make_time TIMESTAMP(3), \n "
+ " A STRING,\n"
+ " B STRING\n"
+ ") WITH (\n"
+ " 'connector' = 'print'\n"
+ ");\n"
+ "insert into TT(make_time,A,B) select make_time,a,b from ST";

@HamaWhiteGG HamaWhiteGG added the bug Something isn't working label Apr 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants