-
Notifications
You must be signed in to change notification settings - Fork 97
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(format): add info codes for supported capabilities #1649
Changes from 11 commits
f13db15
ce63632
6c8ce03
3f0b83e
f0e974d
d84055e
492c333
633e025
aeb0fba
81da8a1
197a470
a52a4fa
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -459,6 +459,28 @@ const struct AdbcError* AdbcErrorFromArrayStream(struct ArrowArrayStream* stream | |
/// | ||
/// \see AdbcConnectionGetInfo | ||
#define ADBC_INFO_VENDOR_ARROW_VERSION 2 | ||
/// \brief Indicates whether the driver connection is read only (type: bool). | ||
/// | ||
/// \see AdbcConnectionGetInfo | ||
#define ADBC_INFO_VENDOR_READ_ONLY 3 | ||
/// \brief Indicates whether SQL queries are supported (type: bool). | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should we also make a new value for There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There's some discussion about this in #1650. What do you think about version There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do you mean for the version returned in GetInfo, or also making a new constant that would be recognized by the driver manager and such? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. As I'm looking through the code now for references to the constant Perhaps we could just do a comment / documentation update here to denote the minor version bump? Also, a refactor of ADBC version handling might be helpful going forward if it would simplify the logic for various feature gates that would allow us to bump versions more seamlessly. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We basically treat the version as an ABI version. Adding constants doesn't change the API, so there's no need to bump. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Or at least, that's my justification for not having to deal with that mess here ^_^ There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think considering the ADBC version to be an ABI version makes sense. If a driver implementation were to adopt this "version" it would not require any changes in behavior, as there's no actual requirement to send or recognize the new constants. I think it may actually be more confusing to describe this as a new version, since there are no discernible differences in behavior between 1.1.0 and 1.1.1. Any objections to moving forward with this PR as it currently is? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm happy with that. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
/// | ||
/// \see AdbcConnectionGetInfo | ||
#define ADBC_INFO_VENDOR_SQL 4 | ||
/// \brief Indicates whether Substrait queries are supported (type: bool). | ||
/// | ||
/// \see AdbcConnectionGetInfo | ||
#define ADBC_INFO_VENDOR_SUBSTRAIT 5 | ||
/// \brief The minimum supported Substrait version, or null if | ||
/// Substrait is not supported (type: utf8). | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Would using a type other than utf8 for a version make sense? The ADBC version appears to have a numeric encoding: /// \since ADBC API revision 1.1.0
#define ADBC_VERSION_1_1_0 1001000 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think a numeric encoding would have some benefits, but in this case utf8 is most consistent with existing encodings of substrait version. For context the version field of There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Leaving a string makes sense to me then 👍 |
||
/// | ||
/// \see AdbcConnectionGetInfo | ||
#define ADBC_INFO_VENDOR_SUBSTRAIT_MIN_VERSION 6 | ||
/// \brief The maximum supported Substrait version, or null if | ||
/// Substrait is not supported (type: utf8). | ||
/// | ||
/// \see AdbcConnectionGetInfo | ||
#define ADBC_INFO_VENDOR_SUBSTRAIT_MAX_VERSION 7 | ||
|
||
/// \brief The driver name (type: utf8). | ||
/// | ||
|
@@ -754,6 +776,24 @@ const struct AdbcError* AdbcErrorFromArrayStream(struct ArrowArrayStream* stream | |
/// schema of the data to append (ADBC_STATUS_ALREADY_EXISTS). | ||
/// \since ADBC API revision 1.1.0 | ||
#define ADBC_INGEST_OPTION_MODE_CREATE_APPEND "adbc.ingest.mode.create_append" | ||
/// \brief The catalog of the table for bulk insert. | ||
/// | ||
/// The type is char*. | ||
#define ADBC_INGEST_OPTION_TARGET_CATALOG "adbc.ingest.target_catalog" | ||
/// \brief The schema of the table for bulk insert. | ||
/// | ||
/// The type is char*. | ||
#define ADBC_INGEST_OPTION_TARGET_DB_SCHEMA "adbc.ingest.target_db_schema" | ||
/// \brief Use a temporary table for ingestion. | ||
/// | ||
/// The value should be ADBC_OPTION_VALUE_ENABLED or | ||
/// ADBC_OPTION_VALUE_DISABLED (the default). | ||
/// | ||
/// This is not supported with ADBC_INGEST_OPTION_TARGET_CATALOG and | ||
/// ADBC_INGEST_OPTION_TARGET_DB_SCHEMA. | ||
/// | ||
/// The type is char*. | ||
#define ADBC_INGEST_OPTION_TEMPORARY "adbc.ingest.temporary" | ||
|
||
/// @} | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm. Should this be an actual option (GetOption/SetOption), since it in principle is mutable in other APIs? e.g. JDBC
Connection#setReadOnly
. Flight SQL of course doesn't let you set this, but it may apply to other things in the future.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point. I actually don't need this particular option, it just seemed useful while I was adding the others. So perhaps it's a better idea to leave it out (and maybe add it to options.h). I can update this tomorrow.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just pushed this change. It turns out that adbc.h already has
ADBC_CONNECTION_OPTION_READ_ONLY
defined, so I didn't need to add anything to options.h.Thanks for the review, it would've been a mistake to make this an info code.