nrg4878 commented on a change in pull request #2246:
URL: https://github.com/apache/hive/pull/2246#discussion_r629562048
##########
File path: ql/src/java/org/apache/hadoop/hive/ql/parse/BaseSemanticAnalyzer.java
##########
@@ -135,6 +136,7 @@
protected Context ctx;
protected Map<String, String> idToTableNameMap;
protected QueryProperties queryProperties;
+ protected static boolean isRemoteType = false;
Review comment:
Why is this variable static? Wouldnt we have an issue if multiple
queries were being processed at a time?
##########
File path: ql/src/java/org/apache/hadoop/hive/ql/parse/BaseSemanticAnalyzer.java
##########
@@ -493,6 +495,10 @@ public static String
getUnescapedUnqualifiedTableName(ASTNode node) throws Seman
return getUnescapedName(node);
}
+ public static boolean getIsRemoteType(){
Review comment:
a) I think we should call this method isDbRemote() or isDatabaseRemote()
instead of getIsRemoteType()
b) this should be either a protected method so its only used by its
sub-classes? being doesnt make much sense given the return value is specific to
a database but it doesnt take any arguments. Or if we want to make it static,
we can add a isDatabaseRemote(Database db) method to a utils function.
##########
File path: ql/src/java/org/apache/hadoop/hive/ql/parse/SemanticAnalyzer.java
##########
@@ -1096,7 +1096,7 @@ private String processTable(QB qb, ASTNode tabref) throws
SemanticException {
ASTNode tableTree = (ASTNode) (tabref.getChild(0));
- String tabIdName = getUnescapedName(tableTree).toLowerCase();
+ String tabIdName =
BaseSemanticAnalyzer.getIsRemoteType()?getUnescapedName(tableTree):
getUnescapedName(tableTree).toLowerCase();
Review comment:
if we make it an instance method, we will not need the classname to
invoke it.
--
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]