zachjsh commented on code in PR #15836:
URL: https://github.com/apache/druid/pull/15836#discussion_r1483699671
##########
sql/src/main/codegen/includes/common.ftl:
##########
@@ -17,59 +17,53 @@
* under the License.
*/
-// Using fully qualified name for Pair class, since Calcite also has a same
class name being used in the Parser.jj
-org.apache.druid.java.util.common.Pair<Granularity, String>
PartitionGranularity() :
+SqlNode PartitionGranularity() :
{
SqlNode e;
- Granularity granularity;
- String unparseString;
+ SqlNode result;
}
{
(
<HOUR>
{
- granularity = Granularities.HOUR;
- unparseString = "HOUR";
+ result = SqlLiteral.createSymbol(GranularityType.HOUR, getPos());
}
|
<DAY>
{
- granularity = Granularities.DAY;
- unparseString = "DAY";
+ result = SqlLiteral.createSymbol(GranularityType.DAY, getPos());
}
|
<MONTH>
{
- granularity = Granularities.MONTH;
- unparseString = "MONTH";
+ result = SqlLiteral.createSymbol(GranularityType.MONTH, getPos());
}
|
<YEAR>
{
- granularity = Granularities.YEAR;
- unparseString = "YEAR";
+ result = SqlLiteral.createSymbol(GranularityType.YEAR, getPos());
}
|
<ALL>
{
- granularity = Granularities.ALL;
- unparseString = "ALL";
+ result = SqlLiteral.createSymbol(GranularityType.ALL, getPos());
}
[
<TIME>
{
- unparseString += " TIME";
+ result = SqlLiteral.createSymbol(GranularityType.ALL, getPos());
Review Comment:
keeping the unparse string now, which is different in each case, so keeping
them separate as before
--
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]