-
Notifications
You must be signed in to change notification settings - Fork 3.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
GH-44569: [GLib] Add GArrowDecimal64DataType #44571
Conversation
|
c_glib/arrow-glib/type.h
Outdated
@@ -97,6 +99,7 @@ typedef enum { | |||
GARROW_TYPE_TIME64, | |||
GARROW_TYPE_MONTH_INTERVAL, | |||
GARROW_TYPE_DAY_TIME_INTERVAL, | |||
GARROW_TYPE_DECIMAL64, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you use the same order as arrow::Type::type
? We want to use the same values as arrow::Type::type
:
arrow/c_glib/arrow-glib/type.h
Line 74 in 2df7b23
* They are corresponding to `arrow::Type::type` values. |
We can use = 44
for now:
arrow/cpp/src/arrow/type_fwd.h
Lines 464 to 465 in 2df7b23
/// Precision- and scale-based decimal type with 64 bits. | |
DECIMAL64 = 44, |
diff --git a/c_glib/arrow-glib/type.h b/c_glib/arrow-glib/type.h
index 6f33ad64ef..9c2843109e 100644
--- a/c_glib/arrow-glib/type.h
+++ b/c_glib/arrow-glib/type.h
@@ -113,6 +113,8 @@ typedef enum {
GARROW_TYPE_LARGE_LIST,
GARROW_TYPE_MONTH_DAY_NANO_INTERVAL,
GARROW_TYPE_RUN_END_ENCODED,
+ /* TODO: Remove = 44 when we add STRING_VIEW..DECIMAL32. */
+ GARROW_TYPE_DECIMAL64 = 44,
} GArrowType;
/**
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks Fixed. What does STRING_VIEW
mean by the way?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
https://arrow.apache.org/docs/format/Columnar.html#variable-size-binary-view-layout
We should support it in GLib too.
c_glib/arrow-glib/type.h
Outdated
* @GARROW_TYPE_DECIMAL64: Precision- and scale-based decimal | ||
* type with 64-bit. Storage type depends on the parameters. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you use the same order as the definition? (Could you move this to after the @GARROW_TYPE_RUN_END_ENCODED
?)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I changed the order in 8217b31
Just a naive problem, why decimal32 not implemented? Just first not involve it in this pull request? |
Right. We'll work on decimal32 in a separated PR. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1
After merging your PR, Conbench analyzed the 3 benchmarking runs that have been run so far on merge-commit 4c36f12. There were no benchmark performance regressions. 🎉 The full Conbench report has more details. It also includes information about 2 possible false positives for unstable benchmarks that are known to sometimes produce them. |
Rationale for this change
arrow::Decimal64Type
data type has been introduced. It is also necessary to support the same data type in GLib.What changes are included in this PR?
This PR implements
GArrowDecimal64DataType
.Are these changes tested?
YES
Are there any user-facing changes?
Before this change:
Arrow::DecimalDataType.new(8, 2)
returnedDecimal128DataType
.After this change:
Arrow::DecimalDataType.new(8, 2)
returnsDecimal64DataType
GArrowDecimal64DataType
#44569