Use `Array::to_arc` instead of `make_array(x.to_data())` and `x.slice(0, x.len())`
Maintainer antworten meist innerhalb von 1 Tag
Dieses Issue hat noch niemand übernommen.
Bewertung
- Schwierigkeit
- 2/5
- Geschätzter Aufwand
- 1-3 Stunden
- Anfängerfreundlichkeit
- 72/100
- Issue-Typ
- Refactoring
- Klarheit
- Klar beschrieben
- Aktivitätsstatus
- Aktiv
- Tech-Stack
- rust
- Bereich
- backend, performance
Rechercherichtung
Vier Aufrufstellen sind mit Zeilenlinks benannt: datafusion/physical-expr-common/src/datum.rs, datafusion/physical-expr/src/expressions/in_list/array_static_filter.rs, datafusion/physical-expr-common/src/utils.rs und datafusion/physical-plan/src/spill/spilled_row_sizes.rs (der Fall dictionary.keys(), der möglicherweise keys.to_arc() am Kindknoten benötigt). Bestätige zuerst, dass die angepinnte arrow-Version in der workspace-Cargo.toml bereits Array::to_arc bereitstellt; falls nicht, ist das Abhängigkeits-Update eine Voraussetzung. Fertig ist, wenn jede Umgehung durch x.to_arc() ersetzt ist und cargo test für die betroffenen Crates erfolgreich läuft.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Beschreibung
Is your feature request related to a problem or challenge?
arrow-rs adds Array::to_arc in apache/arrow-rs#12420, and it is expected to ship in arrow 60.3.0 or 61.0.0. It returns an ArrayRef that shares the buffers of a &dyn Array. When the &dyn Array is an &ArrayRef, it returns a new reference to the same allocation.
DataFusion has four places outside tests that turn a &dyn Array into an ArrayRef with a workaround:
make_array(array.to_data())innormalize_nested_float_zero: https://github.com/apache/datafusion/blob/dbb98dedc329a296a5153019b5ccfdf260088c3f/datafusion/physical-expr-common/src/datum.rs#L128-L131make_array(v.to_data())inArrayStaticFilter::contains: https://github.com/apache/datafusion/blob/dbb98dedc329a296a5153019b5ccfdf260088c3f/datafusion/physical-expr/src/expressions/in_list/array_static_filter.rs#L132truthy.slice(0, truthy.len())in the all-true fast path ofscatter: https://github.com/apache/datafusion/blob/dbb98dedc329a296a5153019b5ccfdf260088c3f/datafusion/physical-expr-common/src/utils.rs#L80-L82make_array(dictionary.keys().to_data())inColumnSize::new: https://github.com/apache/datafusion/blob/dbb98dedc329a296a5153019b5ccfdf260088c3f/datafusion/physical-plan/src/spill/spilled_row_sizes.rs#L158
make_array(x.to_data()) builds an ArrayData and then rebuilds a typed array from it, and nested types repeat that for every child. slice(0, len) recounts the null buffer's nulls and re-slices the children of nested types. to_arc clones an arrow-rs array into a new Arc, and for an ArrayRef it only increments the reference count.
Describe the solution you'd like
After DataFusion upgrades to an arrow release that includes Array::to_arc, replace each workaround above with x.to_arc().
Describe alternatives you've considered
We could keep the workarounds. They return equal arrays but do more work per call.
Additional context
The same arrow-rs PR switches arrow's own cast, concat, nullif, and shift from these workarounds to to_arc.
- Vorherrschende Sprache
- Rust
- Sterne
- 9.6k
- Forks
- 2.7k
- Ø Merge
- 3 T. 17 Std.
- Gemergte PRs (30 T.)
- 318
Entwicklungsumgebung
Startet den Dev-Container des Projekts im Browser, mit Ihrem eigenen GitHub-Konto.
- Kein Dockerfile und keine Docker-Compose-Datei
- Hat eine Pull-Request-Vorlage
- Beitragsleitfaden lesen
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus apache/datafusion
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 62/100
apache/datafusion#27688 ·
Maintainer antworten meist innerhalb von 1 Tag
-
`verify-release-candidate.sh` version check doesn't catch `-dev` versions and is skipped on macOSEvtl. vergeben @vinycalves hat das vor 5 Tagen übernommen. Offen
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 78/100
apache/datafusion#27563 · 2 Kommentare ·
Maintainer antworten meist innerhalb von 1 Tag
-
`MoveTowardsLeafNodes` placement implies speculative evaluation, but the docs don't say soEvtl. vergeben @Inf1mum hat das vor 6 Tagen übernommen. Offen
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 75/100
apache/datafusion#27487 · 3 Kommentare ·
Maintainer antworten meist innerhalb von 1 Tag
-
`lpad` and `rpad` with a literal length above `i32::MAX` error on a NULL string or fillEvtl. vergeben @TechWizard9999 hat das vor 7 Tagen übernommen. Offen
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 77/100
apache/datafusion#27482 · 1 Kommentar · 1 zugewiesene Person ·
Maintainer antworten meist innerhalb von 1 Tag
-
Window constructors panic when the expression list is emptyEvtl. vergeben @abp002 hat das vor 9 Tagen übernommen. Offen
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 72/100
apache/datafusion#27315 · 3 Kommentare · 1 zugewiesene Person ·
Maintainer antworten meist innerhalb von 1 Tag
Alle Issues in apache/datafusion
Ähnliche Issues
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 70/100
topgrade-rs/topgrade#2540 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Invalid JSON options for ngram and edge_ngram silently use defaultsEvtl. vergeben @Tilendlesa hat das heute übernommen. Offen
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 65/100
Maintainer antworten meist innerhalb von 1 Tag
-
bug
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 76/100
noemaforge/vimanam#153 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 88/100
Maintainer antworten meist innerhalb von 3 Tagen
-
bug
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 72/100
Maintainer antworten meist innerhalb von 1 Tag