public final class SerDeUtils extends Object
Modifier and Type | Field and Description |
---|---|
static char |
COLON |
static char |
COLUMN_COMMENTS_DELIMITER |
static char |
COMMA |
static String |
LBRACE |
static String |
LBRACKET |
static org.apache.commons.logging.Log |
LOG |
static char |
QUOTE |
static String |
RBRACE |
static String |
RBRACKET |
Modifier and Type | Method and Description |
---|---|
static Properties |
createOverlayedProperties(Properties tblProps,
Properties partProps)
Returns the union of table and partition properties,
with partition properties taking precedence.
|
static String |
escapeString(String str)
Escape a String in JSON format.
|
static String |
getJSONString(Object o,
ObjectInspector oi) |
static String |
getJSONString(Object o,
ObjectInspector oi,
String nullStr)
Use this if you need to have custom representation of top level null .
|
static boolean |
hasAnyNullObject(List o,
StructObjectInspector loi,
boolean[] nullSafes)
return false though element is null if nullsafe flag is true for that
|
static boolean |
hasAnyNullObject(Object o,
ObjectInspector oi)
True if Object passed is representing null object.
|
static void |
initializeSerDe(Deserializer deserializer,
org.apache.hadoop.conf.Configuration conf,
Properties tblProps,
Properties partProps)
Initializes a SerDe.
|
static void |
initializeSerDeWithoutErrorCheck(Deserializer deserializer,
org.apache.hadoop.conf.Configuration conf,
Properties tblProps,
Properties partProps)
Initializes a SerDe.
|
static String |
lightEscapeString(String str) |
static Object |
toThriftPayload(Object val,
ObjectInspector valOI,
int version)
Convert a Object to a standard Java object in compliance with JDBC 3.0 (see JDBC 3.0
Specification, Table B-3: Mapping from JDBC Types to Java Object Types).
|
static org.apache.hadoop.io.Text |
transformTextFromUTF8(org.apache.hadoop.io.Text text,
Charset targetCharset) |
static org.apache.hadoop.io.Text |
transformTextToUTF8(org.apache.hadoop.io.Text text,
Charset previousCharset) |
public static final char QUOTE
public static final char COLON
public static final char COMMA
public static final char COLUMN_COMMENTS_DELIMITER
public static final String LBRACKET
public static final String RBRACKET
public static final String LBRACE
public static final String RBRACE
public static final org.apache.commons.logging.Log LOG
public static Object toThriftPayload(Object val, ObjectInspector valOI, int version)
HiveResultSetMetaData#hiveTypeToSqlType
.public static String getJSONString(Object o, ObjectInspector oi)
public static String getJSONString(Object o, ObjectInspector oi, String nullStr)
o
- Objectoi
- ObjectInspectornullStr
- The custom string used to represent null valuepublic static boolean hasAnyNullObject(List o, StructObjectInspector loi, boolean[] nullSafes)
public static boolean hasAnyNullObject(Object o, ObjectInspector oi)
o
- The objectoi
- The ObjectInspectorpublic static Properties createOverlayedProperties(Properties tblProps, Properties partProps)
tblProps
- partProps
- public static void initializeSerDe(Deserializer deserializer, org.apache.hadoop.conf.Configuration conf, Properties tblProps, Properties partProps) throws SerDeException
deserializer
- conf
- tblProps
- partProps
- SerDeException
public static void initializeSerDeWithoutErrorCheck(Deserializer deserializer, org.apache.hadoop.conf.Configuration conf, Properties tblProps, Properties partProps) throws SerDeException
deserializer
- conf
- tblProps
- partProps
- SerDeException
public static org.apache.hadoop.io.Text transformTextToUTF8(org.apache.hadoop.io.Text text, Charset previousCharset)
public static org.apache.hadoop.io.Text transformTextFromUTF8(org.apache.hadoop.io.Text text, Charset targetCharset)
Copyright © 2017 The Apache Software Foundation. All rights reserved.