|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.hadoop.hive.ql.parse.BaseSemanticAnalyzer
public abstract class BaseSemanticAnalyzer
BaseSemanticAnalyzer.
| Nested Class Summary | |
|---|---|
static class |
BaseSemanticAnalyzer.tableSpec
tableSpec. |
| Field Summary | |
|---|---|
protected static String |
COLUMNAR_SERDE
|
protected HiveConf |
conf
|
protected SessionState.LogHelper |
console
|
protected Context |
ctx
|
protected Hive |
db
|
protected FetchTask |
fetchTask
|
static int |
HIVE_COLUMN_ORDER_ASC
|
static int |
HIVE_COLUMN_ORDER_DESC
|
protected HashMap<String,String> |
idToTableNameMap
|
protected HashSet<ReadEntity> |
inputs
ReadEntitites that are passed to the hooks. |
protected LineageInfo |
linfo
Lineage information for the query. |
protected org.apache.commons.logging.Log |
LOG
|
protected HashSet<WriteEntity> |
outputs
List of WriteEntities that are passed to the hooks. |
protected QueryProperties |
queryProperties
|
protected static String |
RCFILE_INPUT
|
protected static String |
RCFILE_OUTPUT
|
protected List<Task<? extends Serializable>> |
rootTasks
|
protected static String |
SEQUENCEFILE_INPUT
|
protected static String |
SEQUENCEFILE_OUTPUT
|
protected TableAccessInfo |
tableAccessInfo
|
protected static String |
TEXTFILE_INPUT
|
protected static String |
TEXTFILE_OUTPUT
|
| Constructor Summary | |
|---|---|
BaseSemanticAnalyzer(HiveConf conf)
|
|
| Method Summary | |
|---|---|
void |
analyze(ASTNode ast,
Context ctx)
|
protected void |
analyzeDDLSkewedValues(List<List<String>> skewedValues,
ASTNode child)
Handle skewed values in DDL. |
abstract void |
analyzeInternal(ASTNode ast)
|
protected List<String> |
analyzeSkewedTablDDLColNames(List<String> skewedColNames,
ASTNode child)
Analyze list bucket column names |
protected boolean |
analyzeStoredAdDirs(ASTNode child)
process stored as directories |
static String |
charSetString(String charSetName,
String charSetString)
|
protected HashMap<String,String> |
extractPartitionSpecs(org.antlr.runtime.tree.Tree partspec)
|
protected List<String> |
getColumnNames(ASTNode ast)
|
protected List<Order> |
getColumnNamesOrder(ASTNode ast)
|
protected List<FieldSchema> |
getColumns(ASTNode ast)
|
static List<FieldSchema> |
getColumns(ASTNode ast,
boolean lowerCase)
Get the list of FieldSchema out of the ASTNode. |
Hive |
getDb()
|
FetchTask |
getFetchTask()
|
HashMap<String,String> |
getIdToTableNameMap()
|
HashSet<ReadEntity> |
getInputs()
|
LineageInfo |
getLineageInfo()
Gets the lineage information. |
HashSet<WriteEntity> |
getOutputs()
|
QueryProperties |
getQueryProperties()
|
List<FieldSchema> |
getResultSchema()
|
List<Task<? extends Serializable>> |
getRootTasks()
|
protected List<String> |
getSkewedValueFromASTNode(ASTNode ast)
Given a ASTNode, return list of values. |
protected List<String> |
getSkewedValuesFromASTNode(Node node)
Retrieve skewed values from ASTNode. |
TableAccessInfo |
getTableAccessInfo()
Gets the table access information. |
protected static String |
getTypeStringFromAST(ASTNode typeNode)
|
static String |
getUnescapedName(ASTNode tableOrColumnNode)
Get dequoted name from a table/column node. |
static String |
getUnescapedName(ASTNode tableOrColumnNode,
String currentDatabase)
|
static String |
getUnescapedUnqualifiedTableName(ASTNode node)
Get the unqualified name from a table node. |
protected void |
handleGenericFileFormat(ASTNode node)
|
void |
init()
|
void |
initCtx(Context ctx)
|
boolean |
isValidPrefixSpec(Table tTable,
Map<String,String> spec)
Checks if given specification is proper specification for prefix of partition cols, for table partitioned by ds, hr, min valid ones are (ds='2008-04-08'), (ds='2008-04-08', hr='12'), (ds='2008-04-08', hr='12', min='30') invalid one is for example (ds='2008-04-08', min='30') |
static void |
readProps(ASTNode prop,
Map<String,String> mapProp)
Converts parsed key/value properties pairs into a map. |
protected void |
reset()
|
void |
setFetchTask(FetchTask fetchTask)
|
void |
setLineageInfo(LineageInfo linfo)
Sets the lineage information. |
void |
setTableAccessInfo(TableAccessInfo tableAccessInfo)
Sets the table access information. |
static String |
stripQuotes(String val)
|
static String |
unescapeIdentifier(String val)
Remove the encapsulating "`" pair from the identifier. |
static String |
unescapeSQLString(String b)
|
void |
validate()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected final Hive db
protected final HiveConf conf
protected List<Task<? extends Serializable>> rootTasks
protected FetchTask fetchTask
protected final org.apache.commons.logging.Log LOG
protected final SessionState.LogHelper console
protected Context ctx
protected HashMap<String,String> idToTableNameMap
protected QueryProperties queryProperties
public static int HIVE_COLUMN_ORDER_ASC
public static int HIVE_COLUMN_ORDER_DESC
protected HashSet<ReadEntity> inputs
protected HashSet<WriteEntity> outputs
protected LineageInfo linfo
protected TableAccessInfo tableAccessInfo
protected static final String TEXTFILE_INPUT
protected static final String TEXTFILE_OUTPUT
protected static final String SEQUENCEFILE_INPUT
protected static final String SEQUENCEFILE_OUTPUT
protected static final String RCFILE_INPUT
protected static final String RCFILE_OUTPUT
protected static final String COLUMNAR_SERDE
| Constructor Detail |
|---|
public BaseSemanticAnalyzer(HiveConf conf)
throws SemanticException
SemanticException| Method Detail |
|---|
public HashMap<String,String> getIdToTableNameMap()
public abstract void analyzeInternal(ASTNode ast)
throws SemanticException
SemanticExceptionpublic void init()
public void initCtx(Context ctx)
public void analyze(ASTNode ast,
Context ctx)
throws SemanticException
SemanticException
public void validate()
throws SemanticException
SemanticExceptionpublic List<Task<? extends Serializable>> getRootTasks()
public FetchTask getFetchTask()
public void setFetchTask(FetchTask fetchTask)
fetchTask - the fetchTask to setprotected void reset()
public static String stripQuotes(String val)
public static String charSetString(String charSetName,
String charSetString)
throws SemanticException
SemanticExceptionpublic static String getUnescapedName(ASTNode tableOrColumnNode)
tableOrColumnNode - the table or column node
public static String getUnescapedName(ASTNode tableOrColumnNode,
String currentDatabase)
public static String getUnescapedUnqualifiedTableName(ASTNode node)
node - the table node
public static String unescapeIdentifier(String val)
public static void readProps(ASTNode prop,
Map<String,String> mapProp)
prop - ASTNode parent of the key/value pairsmapProp - property map which receives the mappingspublic static String unescapeSQLString(String b)
public HashSet<ReadEntity> getInputs()
public HashSet<WriteEntity> getOutputs()
public List<FieldSchema> getResultSchema()
protected List<FieldSchema> getColumns(ASTNode ast)
throws SemanticException
SemanticException
protected void handleGenericFileFormat(ASTNode node)
throws SemanticException
SemanticException
public static List<FieldSchema> getColumns(ASTNode ast,
boolean lowerCase)
throws SemanticException
SemanticExceptionprotected List<String> getColumnNames(ASTNode ast)
protected List<Order> getColumnNamesOrder(ASTNode ast)
protected static String getTypeStringFromAST(ASTNode typeNode)
throws SemanticException
SemanticExceptionpublic LineageInfo getLineageInfo()
public void setLineageInfo(LineageInfo linfo)
linfo - The LineageInfo structure that is set in the optimization phase.public TableAccessInfo getTableAccessInfo()
public void setTableAccessInfo(TableAccessInfo tableAccessInfo)
taInfo - The TableAccessInfo structure that is set in the optimization phase.
protected HashMap<String,String> extractPartitionSpecs(org.antlr.runtime.tree.Tree partspec)
throws SemanticException
SemanticException
public final boolean isValidPrefixSpec(Table tTable,
Map<String,String> spec)
throws HiveException
spec - specification key-value map
HiveExceptionpublic Hive getDb()
public QueryProperties getQueryProperties()
protected List<String> getSkewedValueFromASTNode(ASTNode ast)
ast -
protected List<String> getSkewedValuesFromASTNode(Node node)
throws SemanticException
node -
SemanticException
protected List<String> analyzeSkewedTablDDLColNames(List<String> skewedColNames,
ASTNode child)
throws SemanticException
skewedColNames - child -
SemanticException
protected void analyzeDDLSkewedValues(List<List<String>> skewedValues,
ASTNode child)
throws SemanticException
skewedValues - child -
SemanticExceptionprotected boolean analyzeStoredAdDirs(ASTNode child)
child -
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||