Github user sansanichfb commented on a diff in the pull request:
https://github.com/apache/incubator-hawq/pull/1076#discussion_r97715444
--- Diff:
pxf/pxf-hive/src/main/java/org/apache/hawq/pxf/plugins/hive/HiveStringPassResolver.java
---
@@ -42,21 +46,36 @@ public HiveStringPassResolver(InputData input) throws
Exception {
@Override
void parseUserData(InputData input) throws Exception {
- String userData = new String(input.getFragmentUserData());
- String[] toks = userData.split(HiveDataFragmenter.HIVE_UD_DELIM);
+ HiveUserData hiveUserData = HiveUtilities.parseHiveUserData(input);
parseDelimiterChar(input);
parts = new StringBuilder();
- partitionKeys = toks[HiveInputFormatFragmenter.TOK_KEYS];
+ partitionKeys = hiveUserData.getPartitionKeys();
+ serdeClassName = hiveUserData.getSerdeClassName();
+ collectionDelim = input.getUserProperty("COLLECTION_DELIM") ==
null ? COLLECTION_DELIM : input.getUserProperty("COLLECTION_DELIM");
+ mapkeyDelim = input.getUserProperty("MAPKEY_DELIM") == null ?
MAPKEY_DELIM : input.getUserProperty("MAPKEY_DELIM");
+
+ /* Needed only for BINARY format*/
+ if (((ProtocolData) inputData).outputFormat() ==
OutputFormat.BINARY) {
+ propsString = hiveUserData.getPropertiesString();
+ }
}
@Override
- void initSerde(InputData input) {
- /* nothing to do here */
+ void initSerde(InputData input) throws Exception {
+ if (((ProtocolData) inputData).outputFormat() ==
OutputFormat.TEXT) {
--- End diff --
Reverse check.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---