apache / apache/arrow-java

Bug Report: Column Nullability Not Honored in FlightSqlProducer Schema

Aberta
#782 0 comentários 0 reações 0 responsáveis Ver no GitHub
Type: bug
Linguagem predominante
Java
Estrelas
94
Forks
152
Merge médio
3d 16h
PRs com merge (30d)
11

Descrição

### Describe the bug, including details regarding any error messages, version, and platform.

In the FlightSqlProducer class, the getFlightInfoPreparedStatement method is responsible for returning the Arrow Schema of the ResultSet for a given query. However, the returned schema does not accurately reflect the nullability of columns. Regardless of whether a column is defined as nullable or non-nullable, the schema always returns a fixed nullability value.

This leads to incorrect ResultSetMetaData when the schema is consumed via the Flight SQL driver.

Root Cause:

The issue originates in the method:

`org.apache.arrow.driver.jdbc.utils.ConvertUtils.convertArrowFieldsToColumnMetaDataList()`

Here, a list of `org.apache.arrow.vector.types.pojo.Field` objects is converted into `org.apache.calcite.avatica.ColumnMetaData` instances. However, the `setNullable` property of the `ColumnMetaData.Builder` is not being set based on the actual nullability of the Arrow field.

Expected Behavior:

The `setNullable` method of `ColumnMetaData.Builder` should be updated to reflect the value of `field.isNullable()` from the Arrow schema.

Impact:

This bug results in incorrect metadata being exposed to clients using the Flight SQL driver, potentially leading to misinterpretation of the data schema.

Guia de contribuição

Abrir o guia de contribuição

Direção de pesquisa

Comece por org.apache.arrow.driver.jdbc.utils.ConvertUtils.convertArrowFieldsToColumnMetaDataList(), que converte objetos Arrow Field em instâncias de ColumnMetaData para o driver Flight SQL. Verifique como ColumnMetaData.Builder é preenchido e confirme que os metadados resultantes preservam a nullability de cada campo. O trabalho estará concluído quando os campos Arrow nullable e non-nullable expuserem valores correspondentes de ResultSetMetaData.

Escrita pelo modelo de indexação a partir do texto da issue.

Avaliação

Stack de tecnologia
java
Domínio
databases
Tipo de issue
Bug
Dificuldade
2/5
Tempo estimado
1-3 horas
Status de atividade
Estagnada
Clareza
Claramente especificada
Facilidade para iniciantes
55/100

Receba novas issues na sua caixa de entrada

Um resumo curto de issues do GitHub para quem está começando.