akshat-lakhera commented on PR #20722: URL: https://github.com/apache/druid/pull/20722#issuecomment-6398079294
I pushed the changes for all of these in a new commit on top. Most of the hand-built trees in ExpressionsTest now go through the helper, and toArgumentExpression passes a DruidExpression through as is, so the nested concat and regexp_extract cases use it too. That took the file down a lot. The few left by hand are the regexp_like ones with the newline escapes and the specialised ones with custom lambdas, and those lambdas now build the string from args so the two can't drift. buildExpectedExpression is now expectedFunctionCall, and the wrappers in the other files are expectedLeastFunctionCall, expectedGreatestFunctionCall and the IPv4 ones. makeVariable throws if the name isn't in the row signature. For typed nulls I added makeTypedNullLiteral, and passing a null type gives the untyped null that timestamp_floor and timestamp_ceil expect. The javadoc mentions that a plain null is STRING. For substring I added testSubstringWithExtractionFns and testRegexpExtractWithExtractionFns, which plan with sqlUseExtractionFns on and check SubstringDimExtractionFn and RegexDimExtractionFn, plus the cases where no extraction fn should be produced. The expected substring value now spells out the extraction fn, type and expression text itself. It still starts from ofColumn and map, though, because the real result keeps the IDENTIFIER node type of the column and none of the public factories can build that, since ofExpression gives an EXPRESSION node and the deep compare fails on it. Would you rather have a small factory for that in DruidExpression? -- 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] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
