Aarchy commented on code in PR #1553:
URL: https://github.com/apache/phoenix/pull/1553#discussion_r1085154185


##########
phoenix-core/src/main/antlr3/PhoenixSQL.g:
##########
@@ -704,19 +707,31 @@ column_defs returns [List<ColumnDef> ret]
     :  v = column_def {$ret.add(v);}  (COMMA v = column_def {$ret.add(v);} )*
 ;
 
+column_qualifier_counters returns [Map<String, Integer> ret]
+@init{ret = new HashMap<String,Integer>(); }
+    :   k=identifier EQ v=NUMBER {$ret.put(k, Integer.parseInt( v.getText() 
));}
+        (COMMA k=identifier EQ v=NUMBER {$ret.put(k, Integer.parseInt( 
v.getText() ));} )*
+    ;
+
 indexes returns [List<NamedNode> ret]
 @init{ret = new ArrayList<NamedNode>(); }
     :  v = index_name {$ret.add(v);}  (COMMA v = index_name {$ret.add(v);} )*
 ;
 
 column_def returns [ColumnDef ret]
-    :   c=column_name dt=identifier (LPAREN l=NUMBER (COMMA s=NUMBER)? 
RPAREN)? ar=ARRAY? (lsq=LSQUARE (a=NUMBER)? RSQUARE)? (nn=NOT? n=NULL)? 
(DEFAULT df=expression)? (pk=PRIMARY KEY (order=ASC|order=DESC)? 
rr=ROW_TIMESTAMP?)?
-        { $ret = factory.columnDef(c, dt, ar != null || lsq != null, a == null 
? null :  Integer.parseInt( a.getText() ), nn!=null ? Boolean.FALSE : n!=null ? 
Boolean.TRUE : null, 
+    :   c=column_name dt=identifier (LPAREN l=NUMBER (COMMA s=NUMBER)? 
RPAREN)? ar=ARRAY? (lsq=LSQUARE (a=NUMBER)? RSQUARE)? (nn=NOT? n=NULL)? 
(DEFAULT df=expression)? ((pk=PRIMARY KEY (order=ASC|order=DESC)? 
rr=ROW_TIMESTAMP?)|(COLUMN_QUALIFIER_ID cq=NUMBER))?

Review Comment:
   What re the advantages of using encoded binary literals?
   I believe these checks are more readable this way:
   `cq.getValue() < QueryConstants.ENCODED_CQ_COUNTER_INITIAL_VALUE`



-- 
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: issues-unsubscr...@phoenix.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to