public final class DDLUtils extends Object
| Modifier and Type | Method and Description |
|---|---|
static void |
addDbAndTableToOutputs(org.apache.hadoop.hive.metastore.api.Database database,
TableName tableName,
TableType type,
boolean isTemporary,
Map<String,String> properties,
Set<WriteEntity> outputs) |
static boolean |
addIfAbsentByName(WriteEntity newWriteEntity,
DDLOperationContext context) |
static boolean |
addIfAbsentByName(WriteEntity newWriteEntity,
Set<WriteEntity> outputs)
There are many places where "duplicate" Read/WriteEnity objects are added.
|
static void |
addServiceOutput(HiveConf conf,
Set<WriteEntity> outputs) |
static boolean |
allowOperationInReplicationScope(Hive db,
String tableName,
Map<String,String> partSpec,
ReplicationSpec replicationSpec)
Validate if the given table/partition is eligible for update.
|
static String |
getFQName(ASTNode node)
Get the fully qualified name in the node.
|
static void |
validateSerDe(String serdeName,
DDLOperationContext context)
Check if the given serde is valid.
|
static void |
validateSerDe(String serdeName,
HiveConf conf) |
public static boolean addIfAbsentByName(WriteEntity newWriteEntity, Set<WriteEntity> outputs)
WriteEntity.WriteType. It's hard to imagine
how this is desirable.
As of HIVE-14993, WriteEntity with different WriteType must be considered different.
So WriteEntity created in DDLTask cause extra output in golden files, but only because
DDLTask sets a different WriteType for the same Entity.
In the spirit of bug-for-bug compatibility, this method ensures we only add new
WriteEntity if it's really new.true if item was addedpublic static boolean addIfAbsentByName(WriteEntity newWriteEntity, DDLOperationContext context)
public static void validateSerDe(String serdeName, DDLOperationContext context) throws HiveException
HiveExceptionpublic static void validateSerDe(String serdeName, HiveConf conf) throws HiveException
HiveExceptionpublic static boolean allowOperationInReplicationScope(Hive db, String tableName, Map<String,String> partSpec, ReplicationSpec replicationSpec) throws HiveException
db - Database.tableName - Table name of format db.tablepartSpec - Partition spec for the partitionreplicationSpec - Replications specificationHiveExceptionpublic static void addServiceOutput(HiveConf conf, Set<WriteEntity> outputs) throws SemanticException
SemanticExceptionpublic static String getFQName(ASTNode node)
public static void addDbAndTableToOutputs(org.apache.hadoop.hive.metastore.api.Database database, TableName tableName, TableType type, boolean isTemporary, Map<String,String> properties, Set<WriteEntity> outputs)
Copyright © 2022 The Apache Software Foundation. All rights reserved.