public final class ParseUtils extends Object
| Modifier and Type | Class and Description |
|---|---|
static class |
ParseUtils.ReparseResult |
| Modifier and Type | Method and Description |
|---|---|
static boolean |
containsTokenOfType(ASTNode root,
Integer... tokens) |
static boolean |
containsTokenOfType(ASTNode root,
PTFUtils.Predicate<ASTNode> predicate) |
static String |
ensureClassExists(String className) |
static CharTypeInfo |
getCharTypeInfo(ASTNode node) |
static TypeInfo |
getComplexTypeTypeInfo(ASTNode typeNode) |
static DecimalTypeInfo |
getDecimalTypeTypeInfo(ASTNode node) |
static Map<Integer,List<ExprNodeGenericFuncDesc>> |
getFullPartitionSpecs(org.antlr.runtime.tree.CommonTree ast,
Table table,
org.apache.hadoop.conf.Configuration conf,
boolean canGroupExprs)
Get the partition specs from the tree.
|
static String |
getKeywords(Set<String> excludes) |
static VarcharTypeInfo |
getVarcharTypeInfo(ASTNode node) |
static boolean |
isJoinToken(ASTNode node)
Tests whether the parse tree node is a join token.
|
static ASTNode |
parse(String command,
Context ctx)
Parses the Hive query.
|
static ASTNode |
parse(String command,
Context ctx,
String viewFullyQualifiedName)
Parses the Hive query.
|
static CBOPlan |
parseQuery(HiveConf conf,
String viewQuery) |
static List<org.apache.hadoop.hive.metastore.api.FieldSchema> |
parseQueryAndGetSchema(HiveConf conf,
String viewQuery) |
static ParseUtils.ReparseResult |
parseRewrittenQuery(Context ctx,
String rewrittenQueryStr)
Parse the newly generated SQL statement to get a new AST.
|
static ParseUtils.ReparseResult |
parseRewrittenQuery(Context ctx,
StringBuilder rewrittenQueryStr) |
static String |
stripIdentifierQuotes(String val) |
static List<String> |
validateColumnNameUniqueness(List<org.apache.hadoop.hive.metastore.api.FieldSchema> fieldSchemas) |
public static ASTNode parse(String command, Context ctx) throws ParseException
ParseExceptionpublic static ASTNode parse(String command, Context ctx, String viewFullyQualifiedName) throws ParseException
ParseExceptionpublic static boolean isJoinToken(ASTNode node)
node - The parse tree nodepublic static List<String> validateColumnNameUniqueness(List<org.apache.hadoop.hive.metastore.api.FieldSchema> fieldSchemas) throws SemanticException
SemanticExceptionpublic static VarcharTypeInfo getVarcharTypeInfo(ASTNode node) throws SemanticException
SemanticExceptionpublic static CharTypeInfo getCharTypeInfo(ASTNode node) throws SemanticException
SemanticExceptionpublic static DecimalTypeInfo getDecimalTypeTypeInfo(ASTNode node) throws SemanticException
SemanticExceptionpublic static String ensureClassExists(String className) throws SemanticException
SemanticExceptionpublic static boolean containsTokenOfType(ASTNode root, PTFUtils.Predicate<ASTNode> predicate)
public static CBOPlan parseQuery(HiveConf conf, String viewQuery) throws SemanticException, ParseException
SemanticExceptionParseExceptionpublic static List<org.apache.hadoop.hive.metastore.api.FieldSchema> parseQueryAndGetSchema(HiveConf conf, String viewQuery) throws SemanticException, ParseException
SemanticExceptionParseExceptionpublic static Map<Integer,List<ExprNodeGenericFuncDesc>> getFullPartitionSpecs(org.antlr.runtime.tree.CommonTree ast, Table table, org.apache.hadoop.conf.Configuration conf, boolean canGroupExprs) throws SemanticException
SemanticExceptionpublic static ParseUtils.ReparseResult parseRewrittenQuery(Context ctx, StringBuilder rewrittenQueryStr) throws SemanticException
SemanticExceptionpublic static ParseUtils.ReparseResult parseRewrittenQuery(Context ctx, String rewrittenQueryStr) throws SemanticException
SemanticExceptionpublic static TypeInfo getComplexTypeTypeInfo(ASTNode typeNode) throws SemanticException
SemanticExceptionCopyright © 2024 The Apache Software Foundation. All rights reserved.