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

add spark-doris-connector extension #2228

Merged
merged 10 commits into from
Nov 22, 2019
Merged

Conversation

vinson0526
Copy link
Contributor

Spark-Doris-Connector for Spark to query data from Doris.

More info in: #1525

Copy link
Member

@wuyunfeng wuyunfeng left a comment

Choose a reason for hiding this comment

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

This is a great Job! I left some minor comments. Thanks @vinson0526

Copy link
Member

@wuyunfeng wuyunfeng left a comment

Choose a reason for hiding this comment

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

I left some minor comments

@vinson0526 vinson0526 closed this Nov 20, 2019
@vinson0526 vinson0526 reopened this Nov 20, 2019
Copy link
Member

@wuyunfeng wuyunfeng left a comment

Choose a reason for hiding this comment

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

I left some minor comment. @imay Can you spare some time take a look?

open();
}
TException ex = null;
for (int attempt = 0; attempt < retries; ++attempt) {
Copy link
Member

Choose a reason for hiding this comment

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

Maybe getNext does not need to retry? Can you explain this?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

maybe failed because of network error.

logger.debug("CloseScanner to '{}', parameter is '{}'.", routing, closeParams);
if (!isConnected) {
try {
open();
Copy link
Member

Choose a reason for hiding this comment

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

Can you explain why the open() be invoked 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 case of 'close' be called outside, you never know how user use it

return;
}
}
for (int attempt = 0; attempt < retries; ++attempt) {
Copy link
Member

Choose a reason for hiding this comment

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

Maybe close() does not need be invoked many times weather fail or not. @imay WDYT?Doris would process any expired context

Copy link
Contributor Author

Choose a reason for hiding this comment

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

retry is try to resolve network error mainly

private[spark] class DorisPartition(rddId: Int, idx: Int, val dorisPartition: PartitionDefinition)
extends Partition {

override def hashCode(): Int = 41 * (41 * (41 + rddId) + idx) + dorisPartition.hashCode()
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
override def hashCode(): Int = 41 * (41 * (41 + rddId) + idx) + dorisPartition.hashCode()
override def hashCode(): Int = 31 * (31 * (31 + rddId) + idx) + dorisPartition.hashCode()

Copy link
Contributor

@imay imay left a comment

Choose a reason for hiding this comment

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

LGTM

@imay imay merged commit 732c473 into apache:master Nov 22, 2019
@wuyunfeng
Copy link
Member

Thanks @vinson0526

@chaoyli chaoyli mentioned this pull request Feb 10, 2020
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