-
Notifications
You must be signed in to change notification settings - Fork 99
Migrate Parquet support to Mason package #5510
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
Merged
Merged
Changes from all commits
Commits
Show all changes
29 commits
Select commit
Hold shift + click to select a range
7805cba
Add initial migration to Parquet Mason package
eric-vo e48d9ae
Link Parquet Mason package to Arkouda
eric-vo 11420fc
Enhance checkpoint tests and add uint8 handling in parquet tests
eric-vo 5ecf055
Enhance support for uint8 dtype in pdarray creation and tests
eric-vo 11de75e
Remove unnecessary Parquet Makefile comment
eric-vo b6d3e6b
Remove unrelated checkpoint type checking changes
eric-vo ecfbd84
Remove redundant CHPL_HOME check, src/util path workaround, and unnec…
eric-vo 0ce2702
Remove unrelated interpreter reinitialization fix
eric-vo 1473c1b
Add uint8 to binop registration config
eric-vo 04d0524
Remove uint8 additions
eric-vo 0fe0f18
Remove verbose comments
eric-vo f824e68
Add back Arrow 9.0.0 test
eric-vo f498c53
Remove more verbose comments
eric-vo 1550a57
Rename multi-column functions
eric-vo b75bf11
Fix spacing to reduce diff
eric-vo 55c16cb
Re-add comment
eric-vo 3c055f9
Add Arrow to PKG_CONFIG_PATH
eric-vo f18b703
Guard checkpoint writing from compile error from uint(8)
eric-vo e136f7e
Catch unimplemented error instead of using separate argument
eric-vo 31101bc
Add try! to getVersionInfo()
eric-vo a671065
Minimize diff
eric-vo c4f64a5
Merge branch 'main' of https://github.com/Bears-R-Us/arkouda into par…
eric-vo fe21ecd
Catch Arrow version error instead of crashing
eric-vo 820197a
Remove validation for already computed CHPL_HOME
eric-vo e00fa26
Add doc note for using external Parquet download
eric-vo 328acf5
Rename CHPL_HOME to ARKOUDA_CHPL_HOME
eric-vo 72b8ed8
Fix spacing
eric-vo d4bee7b
Pass in ARKOUDA_CHPL_HOME as CHPL_HOME
eric-vo afb92b9
Pass in other ARKOUDA_CHPL_HOME as CHPL_HOME
eric-vo File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,33 +1,6 @@ | ||
| use IO; | ||
| use CTypes; | ||
|
|
||
| require "../src/parquet/WriteParquet.h"; | ||
| require "../src/WriteParquet.o"; | ||
| require "../src/parquet/ReadParquet.h"; | ||
| require "../src/ReadParquet.o"; | ||
| require "../src/parquet/UtilParquet.h"; | ||
| require "../src/UtilParquet.o"; | ||
|
|
||
| proc getVersionInfo() { | ||
| extern proc c_getVersionInfo(): c_ptrConst(c_char); | ||
| extern proc strlen(str): c_int; | ||
| extern proc c_free_string(ptr); | ||
| var cVersionString = c_getVersionInfo(); | ||
| defer { | ||
| c_free_string(cVersionString: c_ptr(void)); | ||
| } | ||
| var ret: string; | ||
| try { | ||
| ret = string.createCopyingBuffer(cVersionString, | ||
| strlen(cVersionString)); | ||
| } catch e { | ||
| ret = "Error converting Arrow version message to Chapel string"; | ||
| } | ||
| return ret; | ||
| } | ||
| use Parquet; | ||
|
|
||
| proc main() { | ||
| var ArrowVersion = getVersionInfo(); | ||
| writeln("Found Arrow version: ", ArrowVersion); | ||
| writeln("Found Arrow version: ", getVersionInfo()); | ||
| return 0; | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| # External Chapel `Parquet` Mason package integration. | ||
| # | ||
| # get_parquet_package.sh clones/builds the package and prints the chpl arguments | ||
| # (C++ prerequisite headers/objects, include paths, Arrow link flags) plus the | ||
| # module source path. We use this instead of `mason modules`, which does not | ||
| # work reliably with Chapel 2.4. Override PARQUET_INSTALL_DIR to relocate the | ||
| # clone; set ARKOUDA_PARQUET_SRC_DIR to reuse an existing checkout. | ||
| PARQUET_PACKAGE_SCRIPT := $(ARKOUDA_PROJECT_DIR)/scripts/get_parquet_package.sh | ||
| PARQUET_INSTALL_DIR ?= $(DEP_BUILD_DIR)/Parquet | ||
|
|
||
| PARQUET_PACKAGE_FLAGS_CMD = env ARKOUDA_CHPL_HOME="$(ARKOUDA_CHPL_HOME)" \ | ||
| "$(PARQUET_PACKAGE_SCRIPT)" "$(PARQUET_INSTALL_DIR)" |
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,74 @@ | ||
| #!/usr/bin/env bash | ||
| # | ||
| # Fetch and build the external Chapel `Parquet` Mason package, then print the | ||
| # `chpl` arguments (C++ prerequisite headers/objects, include paths, Arrow link | ||
| # flags) and the Parquet module source path needed to compile it into the | ||
| # Arkouda server. | ||
| # | ||
| # This is used by the Makefile in place of `mason modules`, which does not work | ||
| # reliably with Chapel 2.4. | ||
| # | ||
| # Contract: ALL human-readable status is written to stderr. The ONLY thing | ||
| # written to stdout is a single line of `chpl` arguments, so a Make recipe can | ||
| # capture it with shell command substitution. | ||
| # | ||
| # Usage: | ||
| # get_parquet_package.sh <install-dir> | ||
| # | ||
| # Environment overrides: | ||
| # ARKOUDA_PARQUET_REPO git URL to clone (default: chapel-lang/Parquet) | ||
| # ARKOUDA_PARQUET_REF branch or tag to check out (default: repo HEAD) | ||
| # ARKOUDA_PARQUET_SRC_DIR use an existing checkout instead of cloning | ||
| # ARKOUDA_CHPL_HOME used to select Chapel's C++ compiler for prereqs | ||
|
|
||
| set -euo pipefail | ||
|
|
||
| log() { echo "get_parquet_package: $*" >&2; } | ||
|
|
||
| PARQUET_REPO="${ARKOUDA_PARQUET_REPO:-https://github.com/chapel-lang/Parquet}" | ||
| PARQUET_REF="${ARKOUDA_PARQUET_REF:-}" | ||
|
|
||
| INSTALL_DIR="${1:-${ARKOUDA_PARQUET_INSTALL_DIR:-}}" | ||
| if [[ -z "${INSTALL_DIR}" ]]; then | ||
| log "ERROR: no install directory provided (pass it as the first argument)" | ||
| exit 1 | ||
| fi | ||
|
|
||
| # Allow pointing at an existing checkout (e.g. a Mason clone) to skip cloning. | ||
| PARQUET_SRC="${ARKOUDA_PARQUET_SRC_DIR:-${INSTALL_DIR}}" | ||
|
|
||
| if [[ -f "${PARQUET_SRC}/Mason.toml" ]]; then | ||
| log "Using existing Parquet checkout at ${PARQUET_SRC}" | ||
| else | ||
| log "Cloning ${PARQUET_REPO}${PARQUET_REF:+@${PARQUET_REF}} into ${PARQUET_SRC}" | ||
| mkdir -p "$(dirname "${PARQUET_SRC}")" | ||
| git clone --depth 1 ${PARQUET_REF:+--branch "${PARQUET_REF}"} \ | ||
| "${PARQUET_REPO}" "${PARQUET_SRC}" >&2 | ||
| fi | ||
|
|
||
| # Resolve to an absolute path so the emitted flags work from any CWD. | ||
| PARQUET_ROOT="$(cd "${PARQUET_SRC}" && pwd -P)" | ||
| PREREQ_DIR="${PARQUET_ROOT}/prereqs/cpp" | ||
| PARQUET_MODULE="${PARQUET_ROOT}/src/Parquet.chpl" | ||
|
|
||
| if [[ ! -d "${PREREQ_DIR}" ]]; then | ||
| log "ERROR: expected C++ prerequisites at ${PREREQ_DIR}, but they are missing" | ||
| exit 1 | ||
| fi | ||
|
|
||
| if [[ ! -f "${PARQUET_MODULE}" ]]; then | ||
| log "ERROR: expected Chapel module at ${PARQUET_MODULE}, but it is missing" | ||
| exit 1 | ||
| fi | ||
|
|
||
| log "Building C++ prerequisites in ${PREREQ_DIR}" | ||
| make -s -C "${PREREQ_DIR}" CHPL_HOME="${ARKOUDA_CHPL_HOME:-}" >&2 | ||
|
|
||
| # Gather the chpl flags the package needs. | ||
| FLAGS="$(make -s -C "${PREREQ_DIR}" CHPL_HOME="${ARKOUDA_CHPL_HOME}" printchplflags)" | ||
| if [[ -z "${FLAGS}" ]]; then | ||
| log "ERROR: the Parquet prerequisite build returned no Chapel flags" | ||
| exit 1 | ||
| fi | ||
|
|
||
| printf '%s %s\n' "${FLAGS}" "${PARQUET_MODULE}" | ||
|
eric-vo marked this conversation as resolved.
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.