Interestingly, the description of sql_data_type in FlightSql.proto includes "The value of the SQL DATA TYPE which has the same values as data_type value."
On Thu, Jan 11, 2024 at 10:06 AM David Li <lidav...@apache.org> wrote: > Those values are inherited from Flight SQL [1] which effectively borrowed > types from JDBC/ODBC. > > xdbc_sql_data_type [2] is defined by an enum [3]. This is the database's > type in its SQL dialect, not the Arrow type. Arrow types are always > represented in Arrow schemas. (This field is a little contradictory to > JDBC, which specifies sql_data_type is unused/reserved.) > > xdbc_data_type [4] is ill-defined I think. James Duong, do you have a > clarification about Dremio's original intent here? In JDBC this is a > java.sql.Types value but it is not explained in Flight SQL. In fact it > seems the proto interchanged the definitions of the two fields, since the > enum above is java.sql.Types. > > > [1]: > https://github.com/apache/arrow-adbc/blob/6b73e529ced2f057aa463e7599c6e1227104b025/adbc.h#L1520-L1522 > [2]: > https://github.com/apache/arrow/blob/2b4a70320232647f730b19d2fea5746c3baec752/format/FlightSql.proto#L1098-L1102 > [3]: > https://github.com/apache/arrow/blob/2b4a70320232647f730b19d2fea5746c3baec752/format/FlightSql.proto#L944-L973 > [4]: > https://github.com/apache/arrow/blob/2b4a70320232647f730b19d2fea5746c3baec752/format/FlightSql.proto#L1067 > > On Thu, Jan 11, 2024, at 12:37, David Coe wrote: > > I recently raised csharp/src/Apache.Arrow/Types/ArrowType: There are > > different type IDs for values after 21, including Decimal128 and > > Decimal256, than for Python * Issue #39568 * apache/arrow > > (github.com)<https://github.com/apache/arrow/issues/39568> because I > > have a downstream system that is interpreting the > > XDBC_DATA_TYPE< > https://github.com/apache/arrow-adbc/blob/6b73e529ced2f057aa463e7599c6e1227104b025/adbc.h#L1501> > > > as the ArrowTypeId and those are different values in different > > languages. > > > > For ADBC, what is the intended distinction between xdbc_data_type and > > xdbc_sql_data_type? Is the xdbc_data_type intended to mimic the C types > > in ODBC? Or is there a different interpretation? And if there are docs > > I don't seem to be finding, please refer me to those. > > > > Thanks, > > > > * David >