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

feat(csharp/src/Drivers/Apache): add implementation for AdbcStatement.SetOption on Spark driver #1849

Merged
merged 5 commits into from
May 13, 2024

Conversation

birschick-bq
Copy link
Contributor

Implement AdbcStatement.SetOption on Spark driver

  • "adbc.statement.polltime_milliseconds" -> sets the poll time to check for results to execute a statement.
  • "adbc.statement.batch_size" -> sets the maximum size of a single batch to receive.


protected internal int BatchSize { get; private set; } = BatchSizeDefault;

public static class StatementOptions
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Making this public seems like the best choice. But if you think it should be private, let me know.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Or maybe made available at the SparkStatement level?

Copy link
Contributor

Choose a reason for hiding this comment

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

What if we establish a convention of having a static class in appropriate places, like

class HiveServer2Statement : AdbcStatement {
    public static class Options {
        // options common to all HiveServer2-derived drivers go here
        public static string PollTimeMilliseconds = "...";
    }
}

class SparkStatement : HiveServer2Statement {
    new public static class Options : HiveServer2Statement.Options {
        // options specific to Spark go here
        // ...
    }
}

@birschick-bq birschick-bq marked this pull request as ready for review May 10, 2024 00:04
@github-actions github-actions bot added this to the ADBC Libraries 13 milestone May 10, 2024
csharp/test/Drivers/Apache/Spark/StatementTests.cs Outdated Show resolved Hide resolved

protected internal int BatchSize { get; private set; } = BatchSizeDefault;

public static class StatementOptions
Copy link
Contributor

Choose a reason for hiding this comment

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

What if we establish a convention of having a static class in appropriate places, like

class HiveServer2Statement : AdbcStatement {
    public static class Options {
        // options common to all HiveServer2-derived drivers go here
        public static string PollTimeMilliseconds = "...";
    }
}

class SparkStatement : HiveServer2Statement {
    new public static class Options : HiveServer2Statement.Options {
        // options specific to Spark go here
        // ...
    }
}

@CurtHagenlocher CurtHagenlocher merged commit a7c1cc6 into apache:main May 13, 2024
6 checks passed
}
else
{
statement.SetOption(SparkStatement.Options.BatchSize, value);
Copy link
Member

Choose a reason for hiding this comment

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

Should these tests roundtrip and verify the option is set correctly?

@birschick-bq birschick-bq deleted the dev/birschick-bq/set-option branch June 4, 2024 17:51
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