FrankChen021 commented on a change in pull request #10635:
URL: https://github.com/apache/druid/pull/10635#discussion_r537243650
##########
File path: sql/src/test/java/org/apache/druid/sql/calcite/CalciteQueryTest.java
##########
@@ -16153,6 +16161,44 @@ public void testTimeStampAddConversion() throws
Exception
);
}
+ public void testSizeFormatFunction() throws Exception
+ {
+ testQuery(
+ "SELECT m1, "
+ + "BINARY_BYTE_FORMAT(45678),"
+ + "BINARY_BYTE_FORMAT(m1*12345),"
+ + "BINARY_BYTE_FORMAT(m1*12345, 0), "
+ + "DECIMAL_BYTE_FORMAT(m1*12345), "
+ + "DECIMAL_FORMAT(m1*12345) "
+ + "FROM numfoo WHERE f1 = 0.1 LIMIT 1",
+ ImmutableList.of(
+ newScanQueryBuilder()
+ .dataSource(CalciteTests.DATASOURCE3)
+ .intervals(querySegmentSpec(Filtration.eternity()))
+ .virtualColumns(expressionVirtualColumn("v0", "'44.61KiB'",
ValueType.STRING),
Review comment:
This is a special case. I also thought it should a function call
expression here. But because the given argument is a constant, this function
call has been calculated during SQL parsing phase before converting to native
sql. I've added some comments in the latest commit here.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]