Skip to content
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

[BugFix] Fix an exception when reading a Paimon table with array<row> column #52743

Merged
merged 1 commit into from
Nov 13, 2024

Conversation

mxdzs0612
Copy link
Contributor

@mxdzs0612 mxdzs0612 commented Nov 8, 2024

Co-authored: @songpcmusic

Why I'm doing:

When creating a Paimon table with following properties:

'fields.claim_info.aggregate-function' = 'nested_update'
'fields.claim_info.nested-key' = 'claim_id'

and the table includes a column like

claim_info      ARRAY<ROW<claim_id varchar, gmt_claim varchar, is_valid BIGINT, leads_entity_id varchar>>

It may return

E20241103 14:41:48.883949 140614797981248 scan_operator.cpp:445] scan fragment b28ba51d-99ae-11ef-a342-02422170dcd7 driver 6 Scan tasks error: Internal error: Failed to call the nextChunkOf
fHeap method of off-heap table scanner. java exception details: java.io.IOException: Failed to get the next off-heap table chunk of paimon.
        at com.starrocks.paimon.reader.PaimonSplitScanner.getNext(PaimonSplitScanner.java:163)                                                                      
        at com.starrocks.jni.connector.ConnectorScanner.getNextOffHeapChunk(ConnectorScanner.java:101)
Caused by: java.lang.ClassCastException: class org.apache.paimon.data.NestedRow cannot be cast to class org.apache.paimon.data.columnar.ColumnarRow (org.apache.paimon.data.NestedRow and org
.apache.paimon.data.columnar.ColumnarRow are in unnamed module of loader com.starrocks.utils.loader.ChildFirstClassLoader @6ebd78d1)
        at com.starrocks.paimon.reader.PaimonColumnValue.unpackStruct(PaimonColumnValue.java:113)
        at com.starrocks.jni.connector.OffHeapColumnVector.appendValue(OffHeapColumnVector.java:568)
        at com.starrocks.jni.connector.OffHeapColumnVector.appendArray(OffHeapColumnVector.java:426)
        at com.starrocks.jni.connector.OffHeapColumnVector.appendValue(OffHeapColumnVector.java:556)                                                                
        at com.starrocks.jni.connector.OffHeapTable.appendData(OffHeapTable.java:95)
        at com.starrocks.jni.connector.ConnectorScanner.appendData(ConnectorScanner.java:86)
        at com.starrocks.paimon.reader.PaimonSplitScanner.getNext(PaimonSplitScanner.java:153)
        ... 1 more

be/src/exec/jni_scanner.cpp:144 _check_jni_exception(env, "Failed to call the nextChunkOffHeap method of off-heap table scanner.")
be/src/exec/jni_scanner.cpp:391 _get_next_chunk(env, &chunk_meta)                                                                                                   
be/src/exec/jni_scanner.cpp:378 value_or_err_L378
be/src/connector/hive_connector.cpp:690 _scanner->get_next(state, chunk)

What I'm doing:

The row maybe NestedRow, not a ColumnarRow. Using InternalRow can solve this problem.

What type of PR is this:

  • BugFix
  • Feature
  • Enhancement
  • Refactor
  • UT
  • Doc
  • Tool

Does this PR entail a change in behavior?

  • Yes, this PR will result in a change in behavior.
  • No, this PR will not result in a change in behavior.

If yes, please specify the type of change:

  • Interface/UI changes: syntax, type conversion, expression evaluation, display information
  • Parameter changes: default values, similar parameters but with different default values
  • Policy changes: use new policy to replace old one, functionality automatically enabled
  • Feature removed
  • Miscellaneous: upgrade & downgrade compatibility, etc.

Checklist:

  • I have added test cases for my bug fix or my new feature
  • This pr needs user documentation (for new or modified features or behaviors)
    • I have added documentation for my new feature or new function
  • This is a backport pr

Bugfix cherry-pick branch check:

  • I have checked the version labels which the pr will be auto-backported to the target branch
    • 3.3
    • 3.2
    • 3.1
    • 3.0
    • 2.5

Signed-off-by: Jiao Mingye <mxdzs0612@gmail.com>
Copy link

sonarqubecloud bot commented Nov 8, 2024

@mxdzs0612 mxdzs0612 changed the title [BugFix] Fix an exception when reading a Paimon table with array<row> [BugFix] Fix an exception when reading a Paimon table with array<row> column Nov 8, 2024
Copy link

github-actions bot commented Nov 8, 2024

[Java-Extensions Incremental Coverage Report]

fail : 0 / 1 (00.00%)

file detail

path covered_line new_line coverage not_covered_line_detail
🔵 com/starrocks/paimon/reader/PaimonColumnValue.java 0 1 00.00% [113]

Copy link

github-actions bot commented Nov 8, 2024

[FE Incremental Coverage Report]

pass : 0 / 0 (0%)

Copy link

github-actions bot commented Nov 8, 2024

[BE Incremental Coverage Report]

pass : 0 / 0 (0%)

@caneGuy caneGuy merged commit 0172fa1 into StarRocks:main Nov 13, 2024
67 of 68 checks passed
Copy link

@Mergifyio backport branch-3.3

@github-actions github-actions bot removed the 3.3 label Nov 13, 2024
Copy link

@Mergifyio backport branch-3.2

@github-actions github-actions bot removed the 3.2 label Nov 13, 2024
Copy link
Contributor

mergify bot commented Nov 13, 2024

backport branch-3.3

✅ Backports have been created

Copy link
Contributor

mergify bot commented Nov 13, 2024

backport branch-3.2

✅ Backports have been created

mergify bot pushed a commit that referenced this pull request Nov 13, 2024
… column (#52743)

Signed-off-by: Jiao Mingye <mxdzs0612@gmail.com>
(cherry picked from commit 0172fa1)
mergify bot pushed a commit that referenced this pull request Nov 13, 2024
… column (#52743)

Signed-off-by: Jiao Mingye <mxdzs0612@gmail.com>
(cherry picked from commit 0172fa1)
@mxdzs0612 mxdzs0612 deleted the fix-paimon-array-struct branch November 13, 2024 09:40
wanpengfei-git pushed a commit that referenced this pull request Nov 15, 2024
… column (backport #52743) (#52877)

Co-authored-by: Jiao Mingye <35512473+mxdzs0612@users.noreply.github.com>
wanpengfei-git pushed a commit that referenced this pull request Nov 15, 2024
… column (backport #52743) (#52876)

Co-authored-by: Jiao Mingye <35512473+mxdzs0612@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants