Repository navigation
Conversation
| size_t size = 0; | ||
| strBuffer.resize(numValues); | ||
| const auto& srcBatch = *SafeCastBatchTo<const BooleanVectorBatch*>(data.get()); | ||
| std::string trueValue = "TRUE"; |
There was a problem hiding this comment.
Does it follow the Java implementation?
There was a problem hiding this comment.
Does it follow the Java implementation?
orc/java/core/src/java/org/apache/orc/impl/ConvertTreeReaderFactory.java
Lines 1118 to 1133 in ec2ea9c
orc/java/core/src/java/org/apache/orc/impl/ConvertTreeReaderFactory.java
Lines 123 to 146 in ec2ea9c
I think so, but i am not good at java, please take a look
| trueValue.resize(readType.getMaximumLength(), ' '); | ||
| falseValue.resize(readType.getMaximumLength(), ' '); | ||
| } else if (readType.getKind() == VARCHAR) { | ||
| trueValue = trueValue.substr(0, std::min(static_cast<uint64_t>(4), readType.getMaximumLength())); |
There was a problem hiding this comment.
I am not sure if it should throw if truncation happens.
| void convertDoubleToDecimal(ReadTypeBatch& dstBatch, uint64_t idx, srcType value) { | ||
| std::string strValue = std::to_string(value); | ||
| int32_t fromScale = 0; | ||
| int32_t fromPrecision = static_cast<int32_t>(strValue.length()); |
There was a problem hiding this comment.
What if value is a negative number?
dongjoon-hyun
left a comment
There was a problem hiding this comment.
In addition to the above comment, could you make CI happy, @ffacs ?
/Users/runner/work/orc/orc/c++/src/ConvertColumnReader.cc:189:9: error: 'ConvertToStringVariantColumnReader' has no out-of-line virtual method definitions; its vtable will be emitted in every translation unit [-Werror,-Wweak-vtables]
class ConvertToStringVariantColumnReader : public ConvertColumnReader {
^
/Users/runner/work/orc/orc/c++/src/ConvertColumnReader.cc:392:9: error: 'ConvertToTimestampColumnReader' has no out-of-line virtual method definitions; its vtable will be emitted in every translation unit [-Werror,-Wweak-vtables]
class ConvertToTimestampColumnReader : public ConvertColumnReader {
^
2 errors generated.
make[2]: *** [c++/src/CMakeFiles/orc.dir/ConvertColumnReader.cc.o] Error 1
make[1]: *** [c++/src/CMakeFiles/orc.dir/all] Error 2
make: *** [all] Error 2
wgtmac
left a comment
There was a problem hiding this comment.
The implementation looks good to me. Left some comments mostly for tests.
|
Thanks @ffacs! Overall looks good. Could you please make all the CIs pass? |
| } | ||
| case LONG: { | ||
| switch (_readType.getKind()) { | ||
| CASE_CREATE_READER(BOOLEAN, LongToBoolean); |
There was a problem hiding this comment.
We need this semicolon removal in branch-1.9 too.
|
Let me bring this to branch-1.9 too~ |
…/decimal/timestamp ### What changes were proposed in this pull request? support conversion from numeric to string group/decimal/timestamp ### Why are the changes needed? To support schema evolution in c++ ### How was this patch tested? UT passed Closes #1500 from ffacs/ORC-1386. Lead-authored-by: ffacs <ffacs520@gmail.com> Co-authored-by: ffacs <ffacs@ffacs.top> Signed-off-by: Gang Wu <ustcwg@gmail.com> (cherry picked from commit b6d595b) Signed-off-by: Dongjoon Hyun <dongjoon@apache.org>
|
Thanks @dongjoon-hyun! |
…/decimal/timestamp ### What changes were proposed in this pull request? support conversion from numeric to string group/decimal/timestamp ### Why are the changes needed? To support schema evolution in c++ ### How was this patch tested? UT passed Closes apache#1500 from ffacs/ORC-1386. Lead-authored-by: ffacs <ffacs520@gmail.com> Co-authored-by: ffacs <ffacs@ffacs.top> Signed-off-by: Gang Wu <ustcwg@gmail.com>
What changes were proposed in this pull request?
support conversion from numeric to string group/decimal/timestamp
Why are the changes needed?
To support schema evolution in c++
How was this patch tested?
UT passed