`array_concat` with an untyped `NULL` argument fails with "does not support type Int64"
Les mainteneurs répondent en général sous 1 jour
Évaluation
- Difficulté
- 2/5
- Temps estimé
- 1-3 heures
- Accessibilité débutants
- 80/100
Piste de recherche
Commencez par lire ArrayConcat::coerce_types et ArrayConcat::return_type, en particulier le fallback coerced_type_with_base_type_only décrit dans l’issue. Reproduisez l’échec avec SELECT array_concat([1, 2], NULL) dans datafusion-cli, puis examinez les tests existants sur la concaténation de tableaux et le cas de NULL typé de #16349. Le travail est terminé lorsque la requête avec NULL non typé renvoie [1, 2] et que la forme array_cat signalée est couverte.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Description
Describe the bug
array_concat / array_cat fails to plan when one of the arguments is a plain NULL literal, and the error message names the element type of the other argument:
> SELECT array_concat([1, 2], NULL);
Error during planning: array_concat does not support type Int64
> SELECT array_cat(NULL, [1, 2]);
Error during planning: array_concat does not support type Int64
The same calls work when the NULL is typed (NULL::int[]) or when a NULL appears inside a list, so this is only the untyped literal:
> SELECT array_concat([1, 2], NULL::int[]);
[1, 2]
> SELECT array_concat([1, 2], [NULL]);
[1, 2, NULL]
ArrayConcat::return_type accepts DataType::Null arguments, but ArrayConcat::coerce_types runs every argument through coerced_type_with_base_type_only, whose fallback arm replaces a non-list type with the base type. The Null argument therefore becomes Int64, and the second return_type call rejects it.
To Reproduce
In datafusion-cli:
SELECT array_concat([1, 2], NULL);
SELECT array_cat(NULL, [1, 2]);
SELECT array_concat(['a'], NULL);
Expected behavior
The untyped NULL is treated like a NULL list of the result type and the other arguments are returned, matching PostgreSQL (array_cat(ARRAY[1, 2], NULL) is {1,2}) and the typed-NULL behavior above:
> SELECT array_concat([1, 2], NULL);
[1, 2]
Additional context
Reproduced on main at 6663e4348 (debug build of datafusion-cli).
#16349 covered NULL::int[] arguments; this is the remaining untyped case. I would like to work on this.
- Langage dominant
- Rust
- Étoiles
- 9.5k
- Forks
- 2.5k
- Merge moyen
- 4 j 19 h
- PR mergées (30 j)
- 342
Préparer son environnement
Lance le conteneur de développement du projet dans votre navigateur, avec votre propre compte GitHub.
- Aucun Dockerfile ni fichier Docker Compose
- Propose un modèle de pull request
- Lire le guide de contribution
Par où commencer
- Lisez l'issue en entier, puis le guide de contribution du projet.
- Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
- Forkez le dépôt et travaillez sur une branche.
- Ouvrez une pull request qui référence le numéro de l'issue.
Autres issues de apache/datafusion
-
[Bug] atan2 does not normalize -0.0 the way Spark doesPeut-être pris @spicysharkco l’a pris il y a 1 jour. Ouvertebug spark
Difficulté 2/5 1-3 heures Accessibilité débutants 72/100
apache/datafusion#26333 ·
Les mainteneurs répondent en général sous 1 jour
-
bug help wanted unparser
Difficulté 2/5 1-3 heures Accessibilité débutants 72/100
apache/datafusion#26316 · 1 commentaire ·
Les mainteneurs répondent en général sous 1 jour
-
Deduplicate bucket computation in width_bucket_interval_mdn_exactPeut-être pris @nightcityblade l’a pris il y a 2 jours. Ouverteenhancement good first issue help wanted spark tech debt
Difficulté 2/5 1-3 heures Accessibilité débutants 85/100
apache/datafusion#26307 · 3 commentaires ·
Les mainteneurs répondent en général sous 1 jour
-
Use the shared aggr_test_schema in CSV scan tests instead of a local copyPeut-être pris @med9110 l’a pris il y a 2 jours. Ouvertecore enhancement good first issue help wanted tech debt
Difficulté 2/5 1-3 heures Accessibilité débutants 85/100
apache/datafusion#26306 · 2 commentaires ·
Les mainteneurs répondent en général sous 1 jour
-
gcd benchmarks pass number_rows: 0 for 100k-row inputsPeut-être pris @med9110 l’a pris il y a 2 jours. Ouvertebug functions good first issue help wanted tech debt
Difficulté 1/5 Moins d'une heure Accessibilité débutants 92/100
apache/datafusion#26297 · 1 commentaire ·
Les mainteneurs répondent en général sous 1 jour
Toutes les issues de apache/datafusion
Issues similaires
-
Stack overflow in `check bans` with `include-dependencies = true` and a dev-dependency cycleOuverte
Difficulté 2/5 1-3 heures Accessibilité débutants 78/100
EmbarkStudios/cargo-deny#910 ·
-
Difficulté 2/5 1-3 heures Accessibilité débutants 68/100
tursodatabase/turso#10054 ·
Les mainteneurs répondent en général sous 1 jour
-
build: Update rust versionPeut-être pris Une pull request liée à cette issue est ouverte ou déjà fusionnée. Ouvertedependencies
Difficulté 2/5 1-3 heures Accessibilité débutants 67/100
ibm-granite-community/granite-cli#229 ·
Les mainteneurs répondent en général sous 1 jour
-
setTargetAtTime booked ahead of time starts its curve early (values blow up before start_time)Ouverte
Difficulté 2/5 1-3 heures Accessibilité débutants 78/100
orottier/web-audio-api-rs#658 ·
-
Difficulté 2/5 1-3 heures Accessibilité débutants 84/100
aosama/astronomical#1318 ·
Les mainteneurs répondent en général sous 1 jour