Skip to content

Conversation

@kushaman
Copy link
Contributor

  1. Added support for the Hive ADBC driver with HTTP transport protocol.
  2. Added new unit tests for Hive ADBC driver support.

@github-actions github-actions bot added this to the ADBC Libraries 17 milestone Feb 19, 2025
{
internal enum HiveServer2AuthType
{
Invalid = 0,
Copy link
Contributor

Choose a reason for hiding this comment

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

Are there tests for each of these types?

Copy link
Contributor

Choose a reason for hiding this comment

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

@davidhcoe - Empty helps the caller differentiate between when no value is associated with the option and Invalid when the option value is unexpected and but not empty. As well, the first item in the enum, 0 (zero) is the 'default' for an enum - again to handle the failed cases.

Copy link
Contributor

Choose a reason for hiding this comment

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

This strikes me as somewhat unidiomatic in that it leads to consuming code which ignores the boolean result. For me, at least, a "Try" method that ignores the result value is a big red flag.

Copy link
Contributor

Choose a reason for hiding this comment

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

It's equally nonidiomatic to even have the Invalid enum member. Typically, I'd expect the TryParse method to return some arbitrary output value when the return value of the function is false. And if it's necessary to store something like a "Value or perhaps undefined" I'd expect e.g. a Nullable<T>.

That said, this is an internal function and not part of the public API and so it could be cleaned up and/or made more idiomatic later.

Copy link
Contributor

@CurtHagenlocher CurtHagenlocher left a comment

Choose a reason for hiding this comment

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

Thanks! I left some comments.

_ => throw new ArgumentOutOfRangeException(nameof(properties), $"Unsupported or unknown value '{type}' given for property '{HiveServer2Parameters.Type}'. Supported types: {HiveServer2TypeParser.SupportedList}"),
};
}

Copy link
Contributor

Choose a reason for hiding this comment

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

nit: extra blank line

Copy link
Contributor

Choose a reason for hiding this comment

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

Resolved.

Copy link
Contributor

Choose a reason for hiding this comment

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

There's still an extra blank line in the latest iteration.

{
internal enum HiveServer2AuthType
{
Invalid = 0,
Copy link
Contributor

Choose a reason for hiding this comment

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

This strikes me as somewhat unidiomatic in that it leads to consuming code which ignores the boolean result. For me, at least, a "Try" method that ignores the result value is a big red flag.

@birschick-bq
Copy link
Contributor

@CurtHagenlocher - PR is ready for review.

@lidavidm lidavidm removed this from the ADBC Libraries 17 milestone Mar 3, 2025
@github-actions github-actions bot added this to the ADBC Libraries 17 milestone Mar 3, 2025
@kushaman kushaman requested a review from CurtHagenlocher March 3, 2025 07:30
Copy link
Contributor

@CurtHagenlocher CurtHagenlocher left a comment

Choose a reason for hiding this comment

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

Thanks again! I've left a few comments around formatting and other nitpicky things. They don't need to block checkin if you'd prefer to address them in a followup. Let me know... .

//SparkServerType.Standard => new SparkStandardConnection(properties),
SparkServerType.Empty => throw new ArgumentException($"Required property '{SparkParameters.Type}' is missing. Supported types: {ServerTypeParser.SupportedList}", nameof(properties)),
_ => throw new ArgumentOutOfRangeException(nameof(properties), $"Unsupported or unknown value '{type}' given for property '{SparkParameters.Type}'. Supported types: {ServerTypeParser.SupportedList}"),

Copy link
Contributor

Choose a reason for hiding this comment

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

nit: extra blank line

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Will do this as a follow up. Created ticket for this :#2569.

statement,
schema,
dataTypeConversion: statement.Connection.DataTypeConversion,
enableBatchSizeStopCondition: false);
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: this block has an extra level of indentation

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Will do this as a follow up. Created ticket for this #2569.

{
internal enum HiveServer2AuthType
{
Invalid = 0,
Copy link
Contributor

Choose a reason for hiding this comment

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

It's equally nonidiomatic to even have the Invalid enum member. Typically, I'd expect the TryParse method to return some arbitrary output value when the return value of the function is false. And if it's necessary to store something like a "Value or perhaps undefined" I'd expect e.g. a Nullable<T>.

That said, this is an internal function and not part of the public API and so it could be cleaned up and/or made more idiomatic later.

@kushaman
Copy link
Contributor Author

kushaman commented Mar 3, 2025

@CurtHagenlocher, Created ticket to follow-up on the above comments #2569.

Please help to merge the change.

@CurtHagenlocher CurtHagenlocher merged commit b0a7b68 into apache:main Mar 3, 2025
6 of 7 checks passed
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.

6 participants