-
Notifications
You must be signed in to change notification settings - Fork 235
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
Adopt JSONUtils.concatenateJsonStrings
for concatenating JSON strings
#11549
Conversation
Signed-off-by: Nghia Truong <nghiat@nvidia.com>
# Conflicts: # sql-plugin/src/main/scala/org/apache/spark/sql/rapids/GpuJsonReadCommon.scala # sql-plugin/src/main/scala/org/apache/spark/sql/rapids/GpuJsonToStructs.scala
# Conflicts: # sql-plugin/src/main/scala/org/apache/spark/sql/rapids/GpuJsonReadCommon.scala
Signed-off-by: Nghia Truong <nghiat@nvidia.com>
Signed-off-by: Nghia Truong <nghiat@nvidia.com>
Signed-off-by: Nghia Truong <nghiat@nvidia.com>
Signed-off-by: Nghia Truong <nghiat@nvidia.com>
|
||
@allow_non_gpu(*non_utc_allow) | ||
def test_from_json_input_wrapped_in_whitespaces(): | ||
json_string_gen = StringGen(r'[ \r\n\t]{0,5}({"key":( |\r|\n|\t|)"[A-z]{0,5}"}|null|invalid|)[ \r\n\t]{0,5}') |
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.
Will generate text that is either:
- '{"key":( |\r|\n|\t|)"[A-z]{0,5}"}'
- 'null'
- 'invalid'
- Empty string
And each of these strings is surrounded by whitespace chars [ \r\n\t]{0,5}
.
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.
Can be tested at https://onlinestringtools.com/generate-string-from-regex
Signed-off-by: Nghia Truong <nghiat@nvidia.com>
Signed-off-by: Nghia Truong <nghiat@nvidia.com>
sql-plugin/src/main/scala/org/apache/spark/sql/rapids/GpuJsonReadCommon.scala
Outdated
Show resolved
Hide resolved
sql-plugin/src/main/scala/org/apache/spark/sql/rapids/GpuJsonToStructs.scala
Show resolved
Hide resolved
build |
build |
Signed-off-by: Nghia Truong <nghiat@nvidia.com>
build |
This adopts the newly implemented
JSONUtils.concatenateJsonStrings
from spark-rapids-jni for concatenating JSON strings into one single string for reading using cudf's JSON reader.Depends on:
concat_json
to join JSON strings given by strings column spark-rapids-jni#2457.This will also closes #10922.