Skip to content

[Feature] Implement DataTypeObjectSerDe::read_column_from_arrow #42406

Closed

Description

@xx-derek

Search before asking

  • I had searched in the issues and found no similar issues.

Description

DataTypeObjectSerDe::read_column_from_arrow is not implemented in data_type_object_serde.h

void read_column_from_arrow(IColumn& column, const arrow::Array* arrow_array, int start,

Use case

Stream load in arrow format does not work with tables that has VARIANT columns without this function.

Related issues

Not found.

Are you willing to submit PR?

  • Yes I am willing to submit a PR!

Code of Conduct

Activity

  1. changed the title [-][Feature] Implement `DataTypeObjectSerDe::write_column_to_arrow`[/-] [+][Feature] Implement `DataTypeObjectSerDe::read_column_to_arrow`[/+] on Oct 24, 2024
  2. changed the title [-][Feature] Implement `DataTypeObjectSerDe::read_column_to_arrow`[/-] [+][Feature] Implement `DataTypeObjectSerDe::read_column_from_arrow`[/+] on Oct 24, 2024
  3. wyxxxcat commented on Oct 27, 2024

    @wyxxxcat
    Collaborator

    Can you give me a reproducible statement?

  4. xx-derek commented on Nov 11, 2024

    @xx-derek
    Author

    Please refer to the following steps to reproduce.

    1. create test table
    CREATE TABLE `demo` (
      `id` int NULL,
      `value` variant NULL
    )
    DUPLICATE KEY(`id`)
    DISTRIBUTED BY RANDOM BUCKETS 16
    1. generate data in arrow stream format
    import numpy as np
    import pyarrow as pa
    
    ids = pa.array(np.arange(100))
    values = pa.array([f'{{\"a\": {i}}}' if i % 2 == 0 else f'{{\"a\": \"{i}\"}}' for i in range(100)])
    
    schema = pa.schema([
        pa.field('id', pa.int32()),
        pa.field('value', values.type)
    ])
    
    with pa.OSFile('payload.dat', 'wb') as sink:
        with pa.ipc.new_stream(sink, schema=schema) as writer:
            batch = pa.record_batch([ids, values], schema=schema)
            writer.write(batch)
    
    print('Done')

    Here I'm populating json strings to value field which is VARIANT in Doris table. The type for this field in arrow structure does not matter in this case.

    1. initiate stream load
    curl --location-trusted -u user:pass \
    -H "Expect:100-continue" \
    -H "format:arrow" \
    -T payload.dat \
    -XPUT http://host:port/api/db_name/demo/_stream_load

    The stream load operation will fail with error message "Failed to convert from arrow to block: [E3] read_column_from_arrow with type variant".

  5. xx-derek commented on Nov 12, 2024

    @xx-derek
    Author

    I'm working on a patch. Can I take this?

  6. github-actions commented on Sep 12, 2025

    @github-actions
    Contributor

    We're closing this issue because it hasn't been updated in a while.
    If you'd like to revive this issue, please reopen it and feel free a maintainer to remove the Stale tag!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions