public class HiveRCSchemaUtil
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
protected static java.util.regex.Pattern |
ptypes
Regex to filter out column types
|
Constructor and Description |
---|
HiveRCSchemaUtil() |
Modifier and Type | Method and Description |
---|---|
static java.util.Set<java.lang.String> |
compileSet(java.lang.String columnsToRead)
Returns a set of columns, with the column names strimmed
|
static java.lang.String |
extractDayDate(java.lang.String fileName)
Extract the date from the hive file names e.g
/user/hive/warehouse/table/daydate=2009-10-01/upload001/0002.dat
This method will extract the 2009-10-01 from this name. |
static java.lang.Object |
extractPigTypeFromHiveType(java.lang.Object value)
Converts from a hive type to a pig type
|
static byte |
findPigDataType(java.lang.String hiveType)
Returns the pig DataType for the hive type
|
static java.lang.String |
listToString(java.util.List<java.lang.String> list)
Trims items in the list.
|
static Tuple |
parseLazyArrayToPigArray(org.apache.hadoop.hive.serde2.lazy.LazyArray arr)
Converts the LazyArray to a Tuple.
|
static InternalMap |
parseLazyMapToPigMap(org.apache.hadoop.hive.serde2.lazy.LazyMap map)
Converts the LazyMap to a InternalMap.
|
static java.util.List<java.lang.String> |
parseSchema(java.util.regex.Pattern pattern,
java.lang.String schema)
General schema parsing method, is used to parse the column names.
|
static java.util.List<java.lang.String> |
parseSchemaTypes(java.lang.String schema)
Parses the schema types and returns a List of these.
|
protected static final java.util.regex.Pattern ptypes
public static java.util.List<java.lang.String> parseSchema(java.util.regex.Pattern pattern, java.lang.String schema)
pattern
- Stringschema
- Stringpublic static java.util.List<java.lang.String> parseSchemaTypes(java.lang.String schema)
schema
- public static final java.lang.String listToString(java.util.List<java.lang.String> list)
list
- public static final java.lang.String extractDayDate(java.lang.String fileName)
fileName
- public static final java.util.Set<java.lang.String> compileSet(java.lang.String columnsToRead)
columnsToRead
- public static byte findPigDataType(java.lang.String hiveType)
hiveType
- public static java.lang.Object extractPigTypeFromHiveType(java.lang.Object value)
value
- Object hive typepublic static InternalMap parseLazyMapToPigMap(org.apache.hadoop.hive.serde2.lazy.LazyMap map)
map
- LazyMappublic static Tuple parseLazyArrayToPigArray(org.apache.hadoop.hive.serde2.lazy.LazyArray arr)
arr
- LazyArrayCopyright © 2007-2012 The Apache Software Foundation