apache / apache/arrow-java

[Java][FlightRPC] Handle binding parameters when server can't provide the expected type

Ouverte
#153 3 commentaires 0 réactions 0 personnes assignées Voir sur GitHub
Langage dominant
Java
Étoiles
94
Forks
152
Merge moyen
3 j 16 h
PR mergées (30 j)
11

Description

### Describe the enhancement requested

Based on apache/arrow-java#156, we need to support the case where the server can't specify the expected type of a given parameter.

> Not all servers can always provide an accurate type for bind parameters. What should we do there? Note that ADBC uses NA/NullType as a wildcard/placeholder type here. This isn't specified in Flight SQL itself, but perhaps we could adopt that convention as well.

Proposal:
- When the server doesn't know the type of any of the parameters, it can just set the parameter schema to `null` (or alternatively, an empty schema).
- When the server doesn't know the type of only some of the parameters, it can just set the respective Field to `NullType`.
- Before we start binding values, we transform the `preparedStatement.getParameterSchema()` based on the types of the given `TypedValues`. If the Schema is empty/null, we create every Field for the schema based on the TypedValue type. Otherwise, we replace all NullType fields with a Field based on the TypedValue.

The only potential drawback I see with this approach is that NullTypes can't be used for parameters. That being said, I can't really think of a case why one would want to do that.

### Component(s)

Java

Guide de contribution

Ouvrir le guide de contribution

Piste de recherche

Commencez par suivre la liaison des instructions préparées de FlightRPC depuis preparedStatement.getParameterSchema() à travers les TypedValues utilisés avant la liaison. Vérifiez la gestion d’un schéma null ou vide ainsi que des champs NullType individuels, avec l’affichage de la complétion lorsque chaque champ du schéma des paramètres est dérivé du type TypedValue correspondant.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Évaluation

Stack technique
java
Domaine
api
Type d'issue
Fonctionnalité
Difficulté
4/5
Temps estimé
3-5 jours
Activité
À l'abandon
Clarté
Plutôt claire
Accessibilité débutants
45/100

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.