public class HiveRCSchemaUtil extends Object
Modifier and Type | Field and Description |
---|---|
protected static Pattern |
ptypes
Regex to filter out column types
|
Constructor and Description |
---|
HiveRCSchemaUtil() |
Modifier and Type | Method and Description |
---|---|
static Set<String> |
compileSet(String columnsToRead)
Returns a set of columns, with the column names strimmed
|
static String |
extractDayDate(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 Object |
extractPigTypeFromHiveType(Object value)
Converts from a hive type to a pig type
|
static byte |
findPigDataType(String hiveType)
Returns the pig DataType for the hive type
|
static String |
listToString(List<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 List<String> |
parseSchema(Pattern pattern,
String schema)
General schema parsing method, is used to parse the column names.
|
static List<String> |
parseSchemaTypes(String schema)
Parses the schema types and returns a List of these.
|
protected static final Pattern ptypes
public static List<String> parseSchema(Pattern pattern, String schema)
pattern
- Stringschema
- Stringpublic static List<String> parseSchemaTypes(String schema)
schema
- public static final String listToString(List<String> list)
list
- public static final String extractDayDate(String fileName)
fileName
- public static final Set<String> compileSet(String columnsToRead)
columnsToRead
- public static byte findPigDataType(String hiveType)
hiveType
- public static Object extractPigTypeFromHiveType(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-2017 The Apache Software Foundation