public class HiveJsonReader extends Object
JSON Type | Java Type | Notes |
---|---|---|
Object | java.util.List | Each element may be different type |
Array | java.util.List | Each element is same type |
Map | java.util.Map | Keys must be same primitive type; every value is the same type |
Modifier and Type | Class and Description |
---|---|
static class |
HiveJsonReader.Feature
Enumeration that defines all on/off features for this reader.
|
Constructor and Description |
---|
HiveJsonReader(ObjectInspector oi)
Constructor with default the Hive default timestamp parser.
|
HiveJsonReader(ObjectInspector oi,
TimestampParser tsParser)
Constructor with default the Hive default timestamp parser.
|
Modifier and Type | Method and Description |
---|---|
void |
disable(HiveJsonReader.Feature feature) |
void |
enable(HiveJsonReader.Feature feature) |
BinaryEncoding |
getBinaryEncodingType() |
Set<HiveJsonReader.Feature> |
getFeatures() |
ObjectInspector |
getObjectInspector() |
boolean |
isEnabled(HiveJsonReader.Feature feature) |
Object |
parseStruct(InputStream in)
Parse text containing a complete JSON object.
|
Object |
parseStruct(String text)
Parse text containing a complete JSON object.
|
void |
setBinaryEncoding(BinaryEncoding encoding) |
String |
toString() |
public HiveJsonReader(ObjectInspector oi)
oi
- ObjectInspector for all the fields in the JSON objectpublic HiveJsonReader(ObjectInspector oi, TimestampParser tsParser)
oi
- ObjectInspector info for all the fields in the JSON objecttsParser
- Custom timestamp parserpublic Object parseStruct(String text) throws IOException, SerDeException
text
- The text to parseIOException
- Unable to parse the JSON textSerDeException
- The SerDe is not configured correctlypublic Object parseStruct(InputStream in) throws IOException, SerDeException
in
- The InputStream to read the text fromIOException
- Unable to parse the JSON textSerDeException
- The SerDe is not configured correctlypublic void enable(HiveJsonReader.Feature feature)
public void disable(HiveJsonReader.Feature feature)
public Set<HiveJsonReader.Feature> getFeatures()
public boolean isEnabled(HiveJsonReader.Feature feature)
public ObjectInspector getObjectInspector()
public BinaryEncoding getBinaryEncodingType()
public void setBinaryEncoding(BinaryEncoding encoding)
Copyright © 2022 The Apache Software Foundation. All rights reserved.