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-44802: [C++][CI] Migrate to arrow::Result based parquet::arrow::OpenFile() API in example tutorials #44807

Merged
merged 3 commits into from
Nov 22, 2024

Conversation

malinjawi
Copy link
Contributor

@malinjawi malinjawi commented Nov 21, 2024

Rationale for this change

This PR address this issue and updates the example-cpp-tutorial in Crossbow to resolve build failures caused by deprecated APIs, as seen in this CI job. The change migrates the examples to non-deprecated APIs to ensure compatibility with the latest Arrow C++ version.

Updating these APIs is necessary to:

Fix build failures and prevent future issues.
Align with the current Arrow C++ API.

What changes are included in this PR?

This PR updates the example-cpp-tutorial to replace deprecated Arrow C++ APIs with the latest supported APIs, resolving build failures in the Crossbow night build.

Are these changes tested?

By running:

$ cd arrow/cpp/examples/tutorial_examples
$ docker compose run --rm tutorial

output:

== Running example project
==

Day:   [
    1,
    12,
    17,
    23,
    28
  ]
Month:   [
    1,
    3,
    5,
    7,
    1
  ]
Year:   [
    1990,
    2000,
    1995,
    2000,
    1995
  ]
Day: int8
Month: int8
Year: int16
----
Day:
  [
    [
      1,
      12,
      17,
      23,
      28
    ],
    [
      6,
      12,
      3,
      30,
      22
    ]
  ]
Month:
  [
    [
      1,
      3,
      5,
      7,
      1
    ],
    [
      5,
      4,
      11,
      3,
      2
    ]
  ]
Year:
  [
    [
      1990,
      2000,
      1995,
      2000,
      1995
    ],
    [
      1980,
      2001,
      1915,
      2020,
      1996
    ]
  ]
Datum kind: Scalar(12891) content type: int64
12891
Datum kind: ChunkedArray([
  [
    75376,
    647,
    2287,
    5671,
    5092
  ]
]) content type: int32
[
  [
    75376,
    647,
    2287,
    5671,
    5092
  ]
]
Datum kind: Scalar(2) content type: int64
2
Found fragment: parquet_dataset/data1.parquet
Partition expression: true
Found fragment: parquet_dataset/data2.parquet
Partition expression: true
a: int64
b: int64
c: int64
----
a:
  [
    [
      0,
      1,
      2,
      3,
      4
    ],
    [
      5,
      6,
      7,
      8,
      9
    ]
  ]
b:
  [
    [
      9,
      8,
      7,
      6,
      5
    ],
    [
      4,
      3,
      2,
      1,
      0
    ]
  ]
c:
  [
    [
      1,
      2,
      1,
      2,
      1
    ],
    [
      2,
      1,
      2,
      1,
      2
    ]
  ]

Are there any user-facing changes?

Yes, the tutorial has been updated to use non-deprecated APIs, which may affect the example code provided to users.

Copy link

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

@kou kou changed the title GH-44802: [C++] [CI] Removed deprecated methods in example tutorials GH-44802: [C++][CI] Migrate to arrow::Result based parquet::arrow::OpenFile() API in example tutorials Nov 21, 2024
@kou
Copy link
Member

kou commented Nov 21, 2024

@github-actions crossbow submit example-cpp-tutorial

Copy link

Revision: 8acc696

Submitted crossbow builds: ursacomputing/crossbow @ actions-08ec77adbe

Task Status
example-cpp-tutorial GitHub Actions

@malinjawi
Copy link
Contributor Author

@kou Thanks for your feedback and review. I have committed your suggested changes. Please let me know if there are any other suggestions.

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 ae497bf into apache:main Nov 22, 2024
35 checks passed
@kou kou removed the awaiting review Awaiting review label Nov 22, 2024
Copy link

After merging your PR, Conbench analyzed the 3 benchmarking runs that have been run so far on merge-commit ae497bf.

There were 132 benchmark results with an error:

There were no benchmark performance regressions. 🎉

The full Conbench report has more details. It also includes information about 5 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.

2 participants