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

[Feature] support reader doris using arrow flight driver #465

Merged
merged 6 commits into from
Aug 12, 2024

Conversation

MaoMiMao
Copy link
Contributor

@MaoMiMao MaoMiMao commented Aug 9, 2024

Proposed changes

Support read doris using arrow flight driver, such as:

        final StreamTableEnvironment tEnv = StreamTableEnvironment.create(env);
        tEnv.executeSql(
                "CREATE TABLE doris_source ("
                        + "name STRING,"
                        + "age int"
                        + ") "
                        + "WITH (\n"
                        + "  'connector' = 'doris',"
                        + "  'fenodes' = '127.0.0.1:8030',"
                        + "  'table.identifier' = 'test.test_flink_f',"
                        + "  'source.use-flight-sql' = 'true',"
                        + "  'source.flight-sql-port' = '8031',"
                        + "  'username' = 'root',"
                        + "  'password' = ''"
                        + ")");
        final Table result = tEnv.sqlQuery("SELECT * from doris_source  ");

Checklist(Required)

  1. Does it affect the original behavior: (Yes/No/I Don't know)
  2. Has unit tests been added: (Yes/No/No Need)
  3. Has document been added or modified: (Yes/No/No Need)
  4. Does it need to update dependencies: (Yes/No)
  5. Are there any changes that cannot be rolled back: (Yes/No)

Further comments

1.motivation by this issue motivation
2. split reader idea by this issue apache/doris#10170

Actual effect after completion
use clickbatch hits table

image

partition.getTabletIds().stream()
.map(Object::toString)
.collect(Collectors.joining(","));
sql += " TABLET(" + tablet + ") ";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why does the tablet need to be spliced ​​in here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In DorisSource.createEnumerator() method, readers split it by node. Currently, doris does not support specifying be node to read data for the time being, so you need to specify a tablet to query

protected AtomicBoolean eos = new AtomicBoolean(false);

public DorisFlightValueReader(
PartitionDefinition partition,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think arrow flight is a new reading method, should we no longer rely on the old reading method?

PartitionDefinition This class was created using the old reading method. Should we give up using this class?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Obtaining the be node arrow readerInfo instance through ticket returns an exception, so the old reading form is temporarily used

@MaoMiMao MaoMiMao requested a review from JNSimba August 12, 2024 06:37
Copy link
Member

@JNSimba JNSimba left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good job, Thanks @MaoMiMao, LGTM

@JNSimba JNSimba merged commit eb90905 into apache:master Aug 12, 2024
7 checks passed
vinlee19 added a commit to vinlee19/doris-flink-connector that referenced this pull request Aug 14, 2024
@JNSimba JNSimba mentioned this pull request Aug 27, 2024
@JNSimba JNSimba mentioned this pull request Sep 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants