mihaibudiu commented on code in PR #4107:
URL: https://github.com/apache/calcite/pull/4107#discussion_r1896896843
##########
core/src/test/resources/org/apache/calcite/test/SqlToRelConverterTest.xml:
##########
@@ -7654,6 +7654,28 @@ from orders]]>
LogicalDelta
LogicalProject(ROWTIME=[$0], PRODUCTID=[$1], ORDERID=[$2], C=[COUNT() OVER
(PARTITION BY $1 ORDER BY $0 RANGE 1000:INTERVAL SECOND PRECEDING)])
LogicalTableScan(table=[[CATALOG, SALES, ORDERS]])
+]]>
+ </Resource>
+ </TestCase>
+ <TestCase name="testStructCast">
+ <Resource name="sql">
+ <![CDATA[select ROW(1, 'x') = ROW('x', 1)]]>
+ </Resource>
+ <Resource name="plan">
+ <![CDATA[
+LogicalProject(EXPR$0=[=(1, CAST('x'):INTEGER NOT NULL)])
+ LogicalValues(tuples=[[{ 0 }]])
+]]>
+ </Resource>
+ </TestCase>
+ <TestCase name="testStructCast1">
+ <Resource name="sql">
+ <![CDATA[select CAST(CAST(ROW('x', 1) AS ROW(l INTEGER, r DOUBLE)) AS
ROW(l BIGINT, r INTEGER)) = ROW(RAND(), RAND())]]>
+ </Resource>
+ <Resource name="plan">
+ <![CDATA[
+LogicalProject(EXPR$0=[AND(=(CAST(CAST('x'):INTEGER NOT NULL):DOUBLE NOT NULL,
RAND()), =(1.0E0, RAND()))])
Review Comment:
yes, there are many places where Calcite simplifies expressions, it's hard
to write a test exhibits just the change I made.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]