|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.pig.piggybank.storage.hiverc.HiveRCSchemaUtil
public class HiveRCSchemaUtil
Implements helper methods for:
Field Summary | |
---|---|
protected static Pattern |
ptypes
Regex to filter out column types |
Constructor Summary | |
---|---|
HiveRCSchemaUtil()
|
Method Summary | |
---|---|
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. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected static final Pattern ptypes
Constructor Detail |
---|
public HiveRCSchemaUtil()
Method Detail |
---|
public static List<String> parseSchema(Pattern pattern, String schema)
pattern
- Stringschema
- String
public 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 type
public static InternalMap parseLazyMapToPigMap(org.apache.hadoop.hive.serde2.lazy.LazyMap map)
map
- LazyMap
public static Tuple parseLazyArrayToPigArray(org.apache.hadoop.hive.serde2.lazy.LazyArray arr)
arr
- LazyArray
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |