-
Notifications
You must be signed in to change notification settings - Fork 39
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix
read_table
compilation on windows (#455)
<!-- Thanks for sending a pull request! Here are some tips for you: 1. If this is your first time, please read our contributor guidelines: https://github.com/delta-incubator/delta-kernel-rs/blob/main/CONTRIBUTING.md 2. Run `cargo t --all-features --all-targets` to get started testing, and run `cargo fmt`. 3. Ensure you have added or run the appropriate tests for your PR. 4. If the PR is unfinished, add '[WIP]' in your PR title, e.g., '[WIP] Your PR title ...'. 5. Be sure to keep the PR description updated to reflect all changes. --> ## What changes are proposed in this pull request? <!-- Please clarify what changes you are proposing and why the changes are needed. The purpose of this section is to outline the changes, why they are needed, and how this PR fixes the issue. If the reason for the change is already explained clearly in an issue, then it does not need to be restated here. 1. If you propose a new API or feature, clarify the use case for a new API or feature. 2. If you fix a bug, you can clarify why it is a bug. --> Make `read_table` actually compile on windows. 1. Add a `strndup` implementation for windows (thanks @hntd187) 2. Fix some types that the windows compiler doesn't like 3. Update `CMakeLists.txt` with correct things (thanks @hntd187 again) 4. Update the README with some minimal instructions. <!-- Uncomment this section if there are any changes affecting public APIs: ### This PR affects the following public APIs If there are breaking changes, please ensure the `breaking-changes` label gets added by CI, and describe why the changes are needed. Note that _new_ public APIs are not considered breaking. --> ## How was this change tested? <!-- Please make sure to add test cases that check the changes thoroughly including negative and positive cases if possible. If it was tested in a way different from regular unit tests, please clarify how you tested, ideally via a reproducible test documented in the PR description. --> Built and run on windows (without `PRINT_DATA`)
- Loading branch information
Showing
5 changed files
with
61 additions
and
9 deletions.
There are no files selected for viewing
This file contains 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 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,4 +1,44 @@ | ||
read table | ||
========== | ||
|
||
Simple example to show how to read and dump the data of a table using kernel's cffi, and arrow-glib | ||
Simple example to show how to read and dump the data of a table using kernel's cffi, and arrow-glib. | ||
|
||
# Building | ||
|
||
This example is built with [cmake]. Instructions below assume you start in the directory containing this README. | ||
|
||
## Linux / MacOS | ||
|
||
Most likely something like this should work: | ||
``` | ||
$ mkdir build | ||
$ cd build | ||
$ cmake .. | ||
$ make | ||
$ ./read_table [path/to/table] | ||
``` | ||
|
||
## Windows | ||
|
||
For windows, assuming you already have a working cmake + c toolchain: | ||
``` | ||
PS mkdir build | ||
PS cd build | ||
PS cmake -G "Visual Studio 17 2022" .. | ||
PS cmake --build . | ||
PS .\Debug\read_table.exe [path\to\table] | ||
``` | ||
|
||
If running on windows you should also run `chcp.exe 65001` to set the codepage to utf-8, or things | ||
won't print out correctly. | ||
|
||
## Arrow GLib | ||
This example uses the `arrow-glib (c)` component from arrow to print out data. This requires | ||
_installing_ that component which can be non-trivial. Please see | ||
[here](https://arrow.apache.org/install/) to find installation instructions for your system. | ||
|
||
If you don't want to have to install this, you can run `ccmake ..` (`cmake-gui.exe ..` on windows) | ||
from the `build` directory, and turn `OFF`/uncheckmark `PRINT_DATA`. Then "configure" and | ||
"generate" and follow the above instructions again. | ||
|
||
[cmake]: https://cmake.org/ |
This file contains 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 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 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