-
Notifications
You must be signed in to change notification settings - Fork 304
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
HPCC-30458 Parquet plugin needs timestamp support #17890
Conversation
https://track.hpccsystems.com/browse/HPCC-30458 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jackdelv I'm not sure about the efficiency of going via text for most of the field types. These look like fairly low level routines that will be called a lot.
897e47f
to
da57f90
Compare
@ghalliday I agree that it was inefficient to go through text for every type. Now it only happens if we are converting data stored in text to other types. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A couple of minor comments, but looks close to ready.
plugins/parquet/parquetembed.cpp
Outdated
} | ||
} | ||
|
||
__int64 ParquetRowBuilder::getCurrValue(const RtlFieldInfo *field) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
possible getCurrIntValue() to make it clear what kind of value it is returning
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changed.
plugins/parquet/parquetembed.cpp
Outdated
return getSigned(array_visitor, currArrayIndex()); | ||
case UIntType: | ||
return getUnsigned(array_visitor, currArrayIndex()); | ||
case DoubleType: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Potential for a getReal() function similar to getSigned/unsigned which returned values for Double/HalfFloat/Float which is also called from getRealResult()
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added a getReal() function and removed extra types. Added getReal to getCurrIntValue() and getRealResult().
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like the further cleanup, switching to use the size.
@@ -872,6 +872,21 @@ unsigned __int64 getUnsigned(std::shared_ptr<ParquetArrayVisitor> *array_visitor | |||
} | |||
} | |||
|
|||
double getReal(std::shared_ptr<ParquetArrayVisitor> *array_visitor, int index) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor: These functions could be static (to avoid the function names being exported globally). Don't change for this PR though.
if ((*array_visitor)->type == RealType) | ||
return getReal(array_visitor, currArrayIndex()); | ||
else | ||
return getCurrIntValue(field); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Strings will not be converted to real values. However I would be tempted to create a separate PR to fix that and merge this one as-is.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jackdelv 1 question, but looks good.
arrow::Status Visit(const arrow::TimestampArray &array) | ||
{ | ||
timestamp_arr = &array; | ||
type = TimestampType; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is it okay to leave size=0 ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, the size only gets used for the Signed, Unsigned, and Real types to differentiate between the different variations of each that can be stored in parquet.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, the size only gets used for the Signed, Unsigned, and Real types to differentiate between the different variations of each that can be stored in parquet.
@jackdelv please squash |
Type of change:
Checklist:
Smoketest:
Testing: