Skip to content
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

Merged
merged 4 commits into from
Oct 30, 2024

Conversation

hiroyuki-sato
Copy link
Contributor

@hiroyuki-sato hiroyuki-sato commented Oct 30, 2024

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) returned Decimal128DataType.
After this change: Arrow::DecimalDataType.new(8, 2) returns Decimal64DataType

Copy link

⚠️ GitHub issue #44569 has been automatically assigned in GitHub to PR creator.

@@ -97,6 +99,7 @@ typedef enum {
GARROW_TYPE_TIME64,
GARROW_TYPE_MONTH_INTERVAL,
GARROW_TYPE_DAY_TIME_INTERVAL,
GARROW_TYPE_DECIMAL64,
Copy link
Member

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:

* They are corresponding to `arrow::Type::type` values.

We can use = 44 for now:

/// 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;
 
 /**

Copy link
Contributor Author

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?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@github-actions github-actions bot added awaiting changes Awaiting changes and removed awaiting review Awaiting review labels Oct 30, 2024
@github-actions github-actions bot added awaiting change review Awaiting change review awaiting changes Awaiting changes and removed awaiting changes Awaiting changes awaiting change review Awaiting change review labels Oct 30, 2024
Comment on lines 53 to 54
* @GARROW_TYPE_DECIMAL64: Precision- and scale-based decimal
* type with 64-bit. Storage type depends on the parameters.
Copy link
Member

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?)

Copy link
Contributor Author

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

@mapleFU
Copy link
Member

mapleFU commented Oct 30, 2024

Just a naive problem, why decimal32 not implemented? Just first not involve it in this pull request?

@kou
Copy link
Member

kou commented Oct 30, 2024

Right. We'll work on decimal32 in a separated PR.
#44392

@github-actions github-actions bot added awaiting change review Awaiting change review and removed awaiting changes Awaiting changes labels Oct 30, 2024
Copy link
Member

@kou kou left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1

@kou kou merged commit 4c36f12 into apache:main Oct 30, 2024
11 checks passed
@kou kou removed the awaiting change review Awaiting change review label Oct 30, 2024
@github-actions github-actions bot added the awaiting merge Awaiting merge label Oct 30, 2024
@hiroyuki-sato hiroyuki-sato deleted the topic/decimal64-data-type branch October 30, 2024 05:20
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants