You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by "tustvold (via GitHub)" <gi...@apache.org> on 2023/02/27 17:09:56 UTC

[GitHub] [arrow-rs] tustvold opened a new pull request, #3769: ArrayData Enumeration for Struct, List, Dictionary

tustvold opened a new pull request, #3769:
URL: https://github.com/apache/arrow-rs/pull/3769

   # Which issue does this PR close?
   
   <!--
   We generally require a GitHub issue to be filed for all bug fixes and enhancements and this helps us generate change logs for our releases. You can link an issue to this PR using the GitHub syntax. For example `Closes #123` indicates that this PR will close issue #123.
   -->
   
   Closes #.
   
   # Rationale for this change
    
   <!--
   Why are you proposing this change? If this is already explained clearly in the issue then this section is not needed.
   Explaining clearly why changes are proposed helps reviewers understand your changes and offer better suggestions for fixes.
   -->
   
   Follow on to https://github.com/apache/arrow-rs/pull/3749 adds more types
   
   # What changes are included in this PR?
   
   <!--
   There is no need to duplicate the description in the issue here but it is sometimes worth providing a summary of the individual changes in this PR.
   -->
   
   # Are there any user-facing changes?
   
   
   <!--
   If there are user-facing changes then we may require documentation to be updated before approving the PR.
   -->
   
   <!---
   If there are any breaking changes to public APIs, please add the `breaking change` label.
   -->
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [arrow-rs] ursabot commented on pull request #3769: ArrayData Enumeration for Remaining Layouts

Posted by "ursabot (via GitHub)" <gi...@apache.org>.
ursabot commented on PR #3769:
URL: https://github.com/apache/arrow-rs/pull/3769#issuecomment-1450021055

   Benchmark runs are scheduled for baseline = d440c244bde4d1e99afcc72ac5b2c049a62f9225 and contender = 7852e763fea66b33a2766b6d6421cafcf6a58c29. 7852e763fea66b33a2766b6d6421cafcf6a58c29 is a master commit associated with this PR. Results will be available as each benchmark for each run completes.
   Conbench compare runs links:
   [Skipped :warning: Benchmarking of arrow-rs-commits is not supported on ec2-t3-xlarge-us-east-2] [ec2-t3-xlarge-us-east-2](https://conbench.ursa.dev/compare/runs/62691bd899b04c6db4bb22a31dcecccd...3830e79cb89643448bcec369525c0b1a/)
   [Skipped :warning: Benchmarking of arrow-rs-commits is not supported on test-mac-arm] [test-mac-arm](https://conbench.ursa.dev/compare/runs/aded177f66c24ca1acb4ed5842c4dea6...a615a40d82cb4ecea88e1173cf8bb966/)
   [Skipped :warning: Benchmarking of arrow-rs-commits is not supported on ursa-i9-9960x] [ursa-i9-9960x](https://conbench.ursa.dev/compare/runs/4eba8cadc7f44cf3be4df0e262ffd23b...d3db4591c09145d9ae51406d85a4a92a/)
   [Skipped :warning: Benchmarking of arrow-rs-commits is not supported on ursa-thinkcentre-m75q] [ursa-thinkcentre-m75q](https://conbench.ursa.dev/compare/runs/283b0f8cdeec47b0adb281e6520ee011...84570be9922c4d93b439bf59f0f5c82a/)
   Buildkite builds:
   Supported benchmarks:
   ec2-t3-xlarge-us-east-2: Supported benchmark langs: Python, R. Runs only benchmarks with cloud = True
   test-mac-arm: Supported benchmark langs: C++, Python, R
   ursa-i9-9960x: Supported benchmark langs: Python, R, JavaScript
   ursa-thinkcentre-m75q: Supported benchmark langs: C++, Java
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [arrow-rs] viirya commented on a diff in pull request #3769: ArrayData Enumeration for Remaining Layouts

Posted by "viirya (via GitHub)" <gi...@apache.org>.
viirya commented on code in PR #3769:
URL: https://github.com/apache/arrow-rs/pull/3769#discussion_r1121167428


##########
arrow-data/src/data/list.rs:
##########
@@ -0,0 +1,241 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+
+use crate::data::types::OffsetType;
+use crate::ArrayData;
+use arrow_buffer::buffer::{NullBuffer, ScalarBuffer};
+use arrow_buffer::{ArrowNativeType, Buffer};
+use arrow_schema::DataType;
+
+mod private {
+    use super::*;
+
+    pub trait ListOffsetSealed {
+        /// Downcast [`ArrayDataList`] to `[ListArrayData`]
+        fn downcast_ref(data: &ArrayDataList) -> Option<&ListArrayData<Self>>
+        where
+            Self: ListOffset;
+
+        /// Downcast [`ArrayDataList`] to `[ListArrayData`]
+        fn downcast(data: ArrayDataList) -> Option<ListArrayData<Self>>
+        where
+            Self: ListOffset;
+
+        /// Cast [`ListArrayData`] to [`ArrayDataList`]
+        fn upcast(v: ListArrayData<Self>) -> ArrayDataList
+        where
+            Self: ListOffset;
+    }
+}
+
+/// Types of offset used by variable length byte arrays

Review Comment:
   ditto.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [arrow-rs] tustvold commented on a diff in pull request #3769: ArrayData Enumeration for Struct, List, Dictionary

Posted by "tustvold (via GitHub)" <gi...@apache.org>.
tustvold commented on code in PR #3769:
URL: https://github.com/apache/arrow-rs/pull/3769#discussion_r1119039912


##########
arrow-data/src/data/bytes.rs:
##########
@@ -270,7 +270,7 @@ impl<O: BytesOffset, B: Bytes> BytesArrayData<O, B> {
 
     /// Returns the offsets
     #[inline]
-    pub fn value_offsets(&self) -> &[O] {
+    pub fn offsets(&self) -> &[O] {

Review Comment:
   The value_ prefix is redundant



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [arrow-rs] viirya commented on a diff in pull request #3769: ArrayData Enumeration for Remaining Layouts

Posted by "viirya (via GitHub)" <gi...@apache.org>.
viirya commented on code in PR #3769:
URL: https://github.com/apache/arrow-rs/pull/3769#discussion_r1121169590


##########
arrow-data/src/data/list.rs:
##########
@@ -0,0 +1,241 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+
+use crate::data::types::OffsetType;
+use crate::ArrayData;
+use arrow_buffer::buffer::{NullBuffer, ScalarBuffer};
+use arrow_buffer::{ArrowNativeType, Buffer};
+use arrow_schema::DataType;
+
+mod private {
+    use super::*;
+
+    pub trait ListOffsetSealed {
+        /// Downcast [`ArrayDataList`] to `[ListArrayData`]
+        fn downcast_ref(data: &ArrayDataList) -> Option<&ListArrayData<Self>>
+        where
+            Self: ListOffset;
+
+        /// Downcast [`ArrayDataList`] to `[ListArrayData`]
+        fn downcast(data: ArrayDataList) -> Option<ListArrayData<Self>>
+        where
+            Self: ListOffset;
+
+        /// Cast [`ListArrayData`] to [`ArrayDataList`]
+        fn upcast(v: ListArrayData<Self>) -> ArrayDataList
+        where
+            Self: ListOffset;
+    }
+}
+
+/// Types of offset used by variable length byte arrays
+pub trait ListOffset: private::ListOffsetSealed + ArrowNativeType {
+    const TYPE: OffsetType;
+}
+
+impl ListOffset for i32 {
+    const TYPE: OffsetType = OffsetType::Int32;
+}
+
+impl private::ListOffsetSealed for i32 {
+    fn downcast_ref(data: &ArrayDataList) -> Option<&ListArrayData<Self>>
+    where
+        Self: ListOffset,
+    {
+        match data {
+            ArrayDataList::Small(v) => Some(v),
+            ArrayDataList::Large(_) => None,
+        }
+    }
+
+    fn downcast(data: ArrayDataList) -> Option<ListArrayData<Self>>
+    where
+        Self: ListOffset,
+    {
+        match data {
+            ArrayDataList::Small(v) => Some(v),
+            ArrayDataList::Large(_) => None,
+        }
+    }
+
+    fn upcast(v: ListArrayData<Self>) -> ArrayDataList
+    where
+        Self: ListOffset,
+    {
+        ArrayDataList::Small(v)
+    }
+}
+
+impl ListOffset for i64 {
+    const TYPE: OffsetType = OffsetType::Int64;
+}
+
+impl private::ListOffsetSealed for i64 {
+    fn downcast_ref(data: &ArrayDataList) -> Option<&ListArrayData<Self>>
+    where
+        Self: ListOffset,
+    {
+        match data {
+            ArrayDataList::Small(_) => None,
+            ArrayDataList::Large(v) => Some(v),
+        }
+    }
+
+    fn downcast(data: ArrayDataList) -> Option<ListArrayData<Self>>
+    where
+        Self: ListOffset,
+    {
+        match data {
+            ArrayDataList::Small(_) => None,
+            ArrayDataList::Large(v) => Some(v),
+        }
+    }
+
+    fn upcast(v: ListArrayData<Self>) -> ArrayDataList
+    where
+        Self: ListOffset,
+    {
+        ArrayDataList::Large(v)
+    }
+}
+
+/// An enumeration of the types of [`ListArrayData`]
+#[derive(Debug, Clone)]
+pub enum ArrayDataList {
+    Small(ListArrayData<i32>),
+    Large(ListArrayData<i64>),
+}
+
+impl ArrayDataList {
+    /// Downcast this [`ArrayDataList`] to the corresponding [`ListArrayData`]
+    pub fn downcast_ref<O: ListOffset>(&self) -> Option<&ListArrayData<O>> {
+        O::downcast_ref(self)
+    }
+
+    /// Downcast this [`ArrayDataList`] to the corresponding [`ListArrayData`]
+    pub fn downcast<O: ListOffset>(self) -> Option<ListArrayData<O>> {
+        O::downcast(self)
+    }
+}
+
+impl<O: ListOffset> From<ListArrayData<O>> for ArrayDataList {
+    fn from(value: ListArrayData<O>) -> Self {
+        O::upcast(value)
+    }
+}
+
+/// ArrayData for [variable-size list arrays](https://arrow.apache.org/docs/format/Columnar.html#variable-size-list-layout)
+#[derive(Debug, Clone)]
+pub struct ListArrayData<O: ListOffset> {
+    data_type: DataType,
+    nulls: Option<NullBuffer>,
+    offsets: ScalarBuffer<O>,
+    child: Box<ArrayData>,
+}
+
+impl<O: ListOffset> ListArrayData<O> {
+    /// Create a new [`ListArrayData`]
+    ///
+    /// # Safety
+    ///
+    /// - Each consecutive window of `offsets` must identify a valid slice of `child`
+    /// - `nulls.len() == offsets.len() + 1`

Review Comment:
   ```suggestion
       /// - `nulls.len() == offsets.len() - 1`
   ```
   ?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [arrow-rs] tustvold commented on a diff in pull request #3769: ArrayData Enumeration for Remaining Types

Posted by "tustvold (via GitHub)" <gi...@apache.org>.
tustvold commented on code in PR #3769:
URL: https://github.com/apache/arrow-rs/pull/3769#discussion_r1119195911


##########
arrow-data/src/data/run.rs:
##########
@@ -0,0 +1,149 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+
+use crate::data::types::RunEndType;
+use crate::ArrayData;
+use arrow_buffer::buffer::ScalarBuffer;
+use arrow_buffer::ArrowNativeType;
+use arrow_schema::DataType;
+use std::marker::PhantomData;
+
+mod private {
+    use super::*;
+
+    pub trait RunEndSealed {
+        /// Downcast [`ArrayDataRun`] to `[RunArrayData`]
+        fn downcast_ref(data: &ArrayDataRun) -> Option<&RunArrayData<Self>>
+        where
+            Self: RunEnd;
+
+        /// Downcast [`ArrayDataRun`] to `[RunArrayData`]
+        fn downcast(data: ArrayDataRun) -> Option<RunArrayData<Self>>
+        where
+            Self: RunEnd;
+
+        /// Cast [`RunArrayData`] to [`ArrayDataRun`]
+        fn upcast(v: RunArrayData<Self>) -> ArrayDataRun
+        where
+            Self: RunEnd;
+    }
+}
+
+pub trait RunEnd: private::RunEndSealed + ArrowNativeType {
+    const TYPE: RunEndType;
+}
+
+macro_rules! run_end {
+    ($t:ty,$v:ident) => {
+        impl RunEnd for $t {
+            const TYPE: RunEndType = RunEndType::$v;
+        }
+        impl private::RunEndSealed for $t {
+            fn downcast_ref(data: &ArrayDataRun) -> Option<&RunArrayData<Self>> {
+                match data {
+                    ArrayDataRun::$v(v) => Some(v),
+                    _ => None,
+                }
+            }
+
+            fn downcast(data: ArrayDataRun) -> Option<RunArrayData<Self>> {
+                match data {
+                    ArrayDataRun::$v(v) => Some(v),
+                    _ => None,
+                }
+            }
+
+            fn upcast(v: RunArrayData<Self>) -> ArrayDataRun {
+                ArrayDataRun::$v(v)
+            }
+        }
+    };
+}
+
+run_end!(i16, Int16);
+run_end!(i32, Int32);
+run_end!(i64, Int64);
+
+/// An enumeration of the types of [`RunArrayData`]
+pub enum ArrayDataRun {
+    Int16(RunArrayData<i16>),
+    Int32(RunArrayData<i32>),
+    Int64(RunArrayData<i64>),
+}
+
+impl ArrayDataRun {
+    /// Downcast this [`ArrayDataRun`] to the corresponding [`RunArrayData`]
+    pub fn downcast_ref<E: RunEnd>(&self) -> Option<&RunArrayData<E>> {
+        E::downcast_ref(self)
+    }
+
+    /// Downcast this [`ArrayDataRun`] to the corresponding [`RunArrayData`]
+    pub fn downcast<E: RunEnd>(self) -> Option<RunArrayData<E>> {
+        E::downcast(self)
+    }
+}
+
+impl<E: RunEnd> From<RunArrayData<E>> for ArrayDataRun {
+    fn from(value: RunArrayData<E>) -> Self {
+        E::upcast(value)
+    }
+}
+
+/// ArrayData for [run-end encoded arrays](https://arrow.apache.org/docs/format/Columnar.html#run-end-encoded-layout)
+pub struct RunArrayData<E: RunEnd> {

Review Comment:
   This is a slight deviation from the spec as defined in https://arrow.apache.org/docs/format/Columnar.html#run-end-encoded-layout in that it "inlines" the run ends. This is consistent with `RunEndArray` and I think makes for a significantly less confusing abstraction.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [arrow-rs] tustvold commented on pull request #3769: ArrayData Enumeration for Remaining Layouts

Posted by "tustvold (via GitHub)" <gi...@apache.org>.
tustvold commented on PR #3769:
URL: https://github.com/apache/arrow-rs/pull/3769#issuecomment-1448907712

   Unless I hear anything further, I plan to merge this tomorrow morning. Please let me know if you need more time to review


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [arrow-rs] viirya commented on a diff in pull request #3769: ArrayData Enumeration for Remaining Layouts

Posted by "viirya (via GitHub)" <gi...@apache.org>.
viirya commented on code in PR #3769:
URL: https://github.com/apache/arrow-rs/pull/3769#discussion_r1121158425


##########
arrow-data/src/data/dictionary.rs:
##########
@@ -0,0 +1,174 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+
+use crate::data::types::DictionaryKeyType;
+use crate::ArrayData;
+use arrow_buffer::buffer::{NullBuffer, ScalarBuffer};
+use arrow_buffer::ArrowNativeType;
+use arrow_schema::DataType;
+
+mod private {
+    use super::*;
+
+    pub trait DictionaryKeySealed {
+        /// Downcast [`ArrayDataDictionary`] to `[DictionaryArrayData`]
+        fn downcast_ref(data: &ArrayDataDictionary) -> Option<&DictionaryArrayData<Self>>
+        where
+            Self: DictionaryKey;
+
+        /// Downcast [`ArrayDataDictionary`] to `[DictionaryArrayData`]
+        fn downcast(data: ArrayDataDictionary) -> Option<DictionaryArrayData<Self>>
+        where
+            Self: DictionaryKey;
+
+        /// Cast [`DictionaryArrayData`] to [`ArrayDataDictionary`]
+        fn upcast(v: DictionaryArrayData<Self>) -> ArrayDataDictionary
+        where
+            Self: DictionaryKey;
+    }
+}
+
+/// Types of offset used by variable length byte arrays

Review Comment:
   Seems wrong due to copying?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [arrow-rs] viirya commented on pull request #3769: ArrayData Enumeration for Remaining Layouts

Posted by "viirya (via GitHub)" <gi...@apache.org>.
viirya commented on PR #3769:
URL: https://github.com/apache/arrow-rs/pull/3769#issuecomment-1448934380

   I will take some time looking at this today but if I cannot, it don't need to block it.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [arrow-rs] viirya commented on a diff in pull request #3769: ArrayData Enumeration for Remaining Layouts

Posted by "viirya (via GitHub)" <gi...@apache.org>.
viirya commented on code in PR #3769:
URL: https://github.com/apache/arrow-rs/pull/3769#discussion_r1121177685


##########
arrow-data/src/data/union.rs:
##########
@@ -0,0 +1,77 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+
+use crate::ArrayData;
+use arrow_buffer::buffer::ScalarBuffer;
+use arrow_schema::DataType;
+
+/// ArrayData for [union arrays](https://arrow.apache.org/docs/format/Columnar.html#union-layout)
+#[derive(Debug, Clone)]
+pub struct UnionArrayData {
+    data_type: DataType,
+    type_ids: ScalarBuffer<i8>,
+    offsets: Option<ScalarBuffer<i32>>,
+    children: Vec<ArrayData>,
+}
+
+impl UnionArrayData {
+    /// Creates a new [`UnionArrayData`]
+    ///
+    /// # Safety
+    ///
+    /// - `data_type` must be valid for this layout
+    /// - `type_ids` must only contain values corresponding to a field in `data_type`
+    /// - `children` must match the field definitions in `data_type`
+    /// - For each value id in type_ids, the corresponding offset, must be in bounds for the child
+    pub unsafe fn new_unchecked(
+        data_type: DataType,
+        type_ids: ScalarBuffer<i8>,
+        offsets: Option<ScalarBuffer<i32>>,
+        children: Vec<ArrayData>,
+    ) -> Self {
+        Self {
+            data_type,
+            type_ids,
+            offsets,
+            children,
+        }
+    }
+
+    /// Returns the type ids for this array if this is a dense union

Review Comment:
   sparse union also has type ids.
   ```suggestion
       /// Returns the type ids for this array
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [arrow-rs] tustvold merged pull request #3769: ArrayData Enumeration for Remaining Layouts

Posted by "tustvold (via GitHub)" <gi...@apache.org>.
tustvold merged PR #3769:
URL: https://github.com/apache/arrow-rs/pull/3769


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [arrow-rs] tustvold commented on a diff in pull request #3769: ArrayData Enumeration for Struct, List, Dictionary

Posted by "tustvold (via GitHub)" <gi...@apache.org>.
tustvold commented on code in PR #3769:
URL: https://github.com/apache/arrow-rs/pull/3769#discussion_r1119040166


##########
arrow-data/src/data/primitive.rs:
##########
@@ -43,13 +43,13 @@ mod private {
 }
 
 pub trait Primitive: private::PrimitiveSealed + ArrowNativeType {
-    const VARIANT: PrimitiveType;
+    const TYPE: PrimitiveType;

Review Comment:
   This makes it consistent with the other traits



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [arrow-rs] tustvold commented on a diff in pull request #3769: ArrayData Enumeration for Struct, List, Dictionary

Posted by "tustvold (via GitHub)" <gi...@apache.org>.
tustvold commented on code in PR #3769:
URL: https://github.com/apache/arrow-rs/pull/3769#discussion_r1119119307


##########
arrow-data/src/data/types.rs:
##########
@@ -141,7 +140,7 @@ impl From<&DataType> for PhysicalType {
                 DataType::UInt64 => Self::Dictionary(DictionaryKeyType::UInt64),
                 d => panic!("illegal dictionary key data type {d}"),
             },
-            DataType::Map(_, _) => Self::Map,
+            DataType::Map(_, _) => Self::List(OffsetType::Int32),

Review Comment:
   MapArray is just a logical type over ListArray



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org