public class PartitionExpressionForMetastore extends Object implements PartitionExpressionProxy
Constructor and Description |
---|
PartitionExpressionForMetastore() |
Modifier and Type | Method and Description |
---|---|
String |
convertExprToFilter(byte[] exprBytes)
Converts serialized Hive expression into filter in the format suitable for Filter.g.
|
org.apache.hadoop.hive.ql.io.sarg.SearchArgument |
createSarg(byte[] expr)
Creates SARG from serialized representation.
|
boolean |
filterPartitionsByExpr(List<FieldSchema> partColumns,
byte[] exprBytes,
String defaultPartitionName,
List<String> partitionNames)
Filters the partition names via serialized Hive expression.
|
FileFormatProxy |
getFileFormatProxy(FileMetadataExprType type)
Gets a separate proxy that can be used to call file-format-specific methods.
|
FileMetadataExprType |
getMetadataType(String inputFormat)
Determines the file metadata type from input format of the source table or partition.
|
public String convertExprToFilter(byte[] exprBytes) throws MetaException
PartitionExpressionProxy
convertExprToFilter
in interface PartitionExpressionProxy
exprBytes
- Serialized expression.MetaException
public boolean filterPartitionsByExpr(List<FieldSchema> partColumns, byte[] exprBytes, String defaultPartitionName, List<String> partitionNames) throws MetaException
PartitionExpressionProxy
filterPartitionsByExpr
in interface PartitionExpressionProxy
partColumns
- Partition columns in the underlying table.exprBytes
- Serialized expression.defaultPartitionName
- Default partition name from job or server configuration.partitionNames
- Partition names; the list is modified in place.MetaException
public FileFormatProxy getFileFormatProxy(FileMetadataExprType type)
PartitionExpressionProxy
getFileFormatProxy
in interface PartitionExpressionProxy
type
- The file metadata type.public FileMetadataExprType getMetadataType(String inputFormat)
PartitionExpressionProxy
getMetadataType
in interface PartitionExpressionProxy
inputFormat
- Input format name.public org.apache.hadoop.hive.ql.io.sarg.SearchArgument createSarg(byte[] expr)
PartitionExpressionProxy
createSarg
in interface PartitionExpressionProxy
expr
- SARG, serialized as Kryo.Copyright © 2019 The Apache Software Foundation. All rights reserved.