Skip to content
This repository was archived by the owner on May 12, 2021. It is now read-only.

Comments

TAJO-2164: SequenceFile print wrong values with TextSerializerDeserializer#1033

Closed
blrunner wants to merge 7 commits intoapache:masterfrom
blrunner:TAJO-2164
Closed

TAJO-2164: SequenceFile print wrong values with TextSerializerDeserializer#1033
blrunner wants to merge 7 commits intoapache:masterfrom
blrunner:TAJO-2164

Conversation

@blrunner
Copy link
Contributor

if (delim == null || delim.isEmpty()) {
delim = meta.getProperty(StorageConstants.TEXT_DELIMITER, StorageConstants.DEFAULT_FIELD_DELIMITER);
}
meta.getPropertySet().set(StorageConstants.TEXT_DELIMITER, delim);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The property order should be TEXT_DELIMITER, SEQUENCEFILE_DELIMITER and please use default value of getProperty.
Why you set the property ? is there any reason ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If users only set SEQUENCEFILE_DELIMITER, TextLineSerDe can't delimit records because TextLineSerDe use TEXT_DELIMITER as the delimiter. I modified codes again as follows. The value of SEQUENCEFILE_DELIMITER will only use if TEXT_DELIMITER doesn't exit and SEQUENCEFILE_DELIMITER exists only.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you can change to simplify code like this

TableMeta tableMeta = meta.clone();
    if (!tableMeta.containsProperty(StorageConstants.TEXT_DELIMITER)) {
      tableMeta.putProperty(StorageConstants.TEXT_DELIMITER, tableMeta.getProperty(StorageConstants.SEQUENCEFILE_DELIMITER);
    }

also you should consider the null char and you should remove useless code

keyValueSet.set(StorageConstants.TEXT_DELIMITER, meta.getProperty(StorageConstants.SEQUENCEFILE_DELIMITER));
}

String delim = meta.getProperty(StorageConstants.TEXT_DELIMITER, StorageConstants.DEFAULT_FIELD_DELIMITER);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove unused code

@blrunner
Copy link
Contributor Author

Thanks @jinossy ,
I rebases your comments and added more unit tests.

@jinossy
Copy link
Member

jinossy commented Jun 20, 2016

+1 LGTM
I'm sorry for late review

@jihoonson
Copy link
Contributor

Jaehwa looks busy, so I'll commit this patch soon.

@blrunner
Copy link
Contributor Author

Thanks guys, I'll ship it tonight.

@asfgit asfgit closed this in 8dbb8ca Jun 25, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants