-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
support to read binary as string in parquet #10399
base: main
Are you sure you want to change the base?
Conversation
✅ Deploy Preview for meta-velox canceled.
|
@@ -655,12 +653,17 @@ TypePtr ReaderBase::convertType( | |||
return DOUBLE(); | |||
case thrift::Type::type::BYTE_ARRAY: | |||
case thrift::Type::type::FIXED_LEN_BYTE_ARRAY: | |||
if (binaryAsString) { | |||
return VARCHAR(); | |||
if (options_.fileSchema()->containsChild(schemaElement.name)) { |
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.
Should this be
auto requestedType = options_.requestedType() ? options_.requestedType(): schema();
@@ -655,12 +653,18 @@ TypePtr ReaderBase::convertType( | |||
return DOUBLE(); | |||
case thrift::Type::type::BYTE_ARRAY: | |||
case thrift::Type::type::FIXED_LEN_BYTE_ARRAY: | |||
if (binaryAsString) { | |||
return VARCHAR(); | |||
if (options_.fileSchema() != nullPtr |
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.
You probably need to add requestedType
to getParquetColumnInfo
to handle nested VARBINARY
as well
const TypePtr& ReaderBase::getChildRequestedSchema( | ||
const TypePtr& requestedSchema, | ||
std::string& name) const { | ||
if (!requestedSchema && requestedSchema->isRow() && |
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.
if (!requestedSchema) {
VELOX_CHECK(requestedSchema->isRow() && requestedSchema->asRow().containsChild(name));
} else {
TypePtr ReaderBase::convertType( | ||
const thrift::SchemaElement& schemaElement) const { | ||
const thrift::SchemaElement& schemaElement, | ||
const TypePtr& requestedSchema) const { |
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.
Here it is requestedType
not requestedSchema
if (binaryAsString) { | ||
return VARCHAR(); | ||
case thrift::Type::type::FIXED_LEN_BYTE_ARRAY: { | ||
if (requestedSchema != nullptr && requestedSchema->isRow() && |
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.
And we don't need these
Summary:
Some other Parquet-producing systems, in particular Impala, will write string-type data as binary into Parquet file. and Velox's ParquetReader does not support binaryAsString. this PR is intended to resolve this issue.
issue resolved: [#10398]