ramitg254 commented on code in PR #5973:
URL: https://github.com/apache/hive/pull/5973#discussion_r2237463048


##########
ql/src/java/org/apache/hadoop/hive/ql/parse/BaseSemanticAnalyzer.java:
##########
@@ -233,15 +233,39 @@ public boolean isPrepareQuery() {
     return prepareQuery;
   }
 
-  static final class RowFormatParams {
+  public static final class RowFormatParams {
     String fieldDelim = null;
     String fieldEscape = null;
     String collItemDelim = null;
     String mapKeyDelim = null;
     String lineDelim = null;
     String nullFormat = null;

Review Comment:
   @kasakrisz making these private sounds good but in case of making these 
fields immutable via final may lead to extra handling of behaviour for 
RowFormatParams object as there are many occurences where `analyzeRowFormat()` 
method is called only when this condition holds: `case 
HiveParser.TOK_TABLEROWFORMAT` and if this condition is false then default 
values of these fields which is null is passed to descriptor like :
   ```
   new CreateTableDesc(qualifiedTabName, isExt, isTemporary, cols, 
partColNames, bucketCols, sortCols,
               numBuckets, rowFormatParams.getFieldDelim(), 
rowFormatParams.getFieldEscape(),
               rowFormatParams.getCollItemDelim(), 
rowFormatParams.getMapKeyDelim(), rowFormatParams.getLineDelim(),
               comment, storageFormat.getInputFormat(), 
storageFormat.getOutputFormat(), location,
               storageFormat.getSerde(), storageFormat.getStorageHandler(), 
storageFormat.getSerdeProps(), tblProps,
               ifNotExists, skewedColNames, skewedValues, true, primaryKeys, 
foreignKeys, uniqueConstraints,
               notNullConstraints, defaultConstraints, checkConstraints);
   ```
   so by use of factory method via `analyzeRowFormat` due to immutable fields 
will give arise to more use of if statements or ternary operators in situtation 
like these



-- 
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: gitbox-unsubscr...@hive.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscr...@hive.apache.org
For additional commands, e-mail: gitbox-h...@hive.apache.org

Reply via email to