Skip to content

Commit

Permalink
Upgrade based DataFusion to 10.0.0 (#18)
Browse files Browse the repository at this point in the history
  • Loading branch information
kou committed Aug 13, 2022
1 parent db57572 commit d54bdf1
Show file tree
Hide file tree
Showing 18 changed files with 84 additions and 172 deletions.
17 changes: 7 additions & 10 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -156,14 +156,12 @@ jobs:
- name: Setup on non-Windows
if: |
matrix.runs-on != 'windows-latest'
# Enable -Dvapi=true and -Dwerror=true after Apache Arrow GLib
# 9.0.0 is released.
run: |
meson setup \
--prefix=${HOME}/local \
-Ddoc=true \
-Dvapi=false \
-Dwerror=false \
-Dvapi=${{ matrix.runs-on == 'ubuntu-latest' }} \
-Dwerror=true \
build \
.
- name: Build on non-Windows
Expand Down Expand Up @@ -193,12 +191,11 @@ jobs:
matrix.runs-on != 'windows-latest'
run: |
build/examples/sql-c
# Enable this after Apache Arrow GLib 9.0.0 is released.
# - name: Run Vala example
# if: |
# matrix.runs-on != 'windows-latest'
# run: |
# build/examples/sql-vala
- name: Run Vala example
if: |
matrix.runs-on == 'ubuntu-latest'
run: |
build/examples/sql-vala
- name: Run Python example
if: |
matrix.runs-on != 'windows-latest'
Expand Down
1 change: 1 addition & 0 deletions Brewfile
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
# under the License.

brew "apache-arrow-glib"
brew "glib-utils"
brew "gobject-introspection"
brew "gtk-doc"
brew "meson"
Expand Down
4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
[package]
name = "datafusion-c"
description = "DataFusion C API"
version = "8.0.0"
version = "10.0.0"
homepage = "https://github.com/datafusion-contrib/datafusion-c"
repository = "https://github.com/datafusion-contrib/datafusion-c"
readme = "README.md"
Expand All @@ -40,7 +40,7 @@ default = ["capi"]
capi = []

[dependencies]
datafusion = "8"
datafusion = "10"
libc = "0.2"
tokio = "1"

Expand Down
2 changes: 1 addition & 1 deletion datafusion-glib/data-frame-raw.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@

G_BEGIN_DECLS

GDF_AVAILABLE_IN_8_0
GDF_AVAILABLE_IN_10_0
GDFDataFrame *
gdf_data_frame_new_raw(DFDataFrame *raw_data_frame);

Expand Down
4 changes: 2 additions & 2 deletions datafusion-glib/data-frame.c
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ gdf_data_frame_class_init(GDFDataFrameClass *klass)
*
* Shows @data_frame content to standard output.
*
* Since: 8.0.0
* Since: 10.0.0
*/
gboolean
gdf_data_frame_show(GDFDataFrame *data_frame, GError **error)
Expand Down Expand Up @@ -123,7 +123,7 @@ gdf_data_frame_show(GDFDataFrame *data_frame, GError **error)
*
* Returns: (transfer full): A #GArrowTable of this data frame, %NULL on error.
*
* Since: 8.0.0
* Since: 10.0.0
*/
GArrowTable *
gdf_data_frame_to_table(GDFDataFrame *data_frame, GError **error)
Expand Down
4 changes: 2 additions & 2 deletions datafusion-glib/data-frame.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,10 @@ struct _GDFDataFrameClass
GObjectClass parent_class;
};

GDF_AVAILABLE_IN_8_0
GDF_AVAILABLE_IN_10_0
gboolean
gdf_data_frame_show(GDFDataFrame *data_frame, GError **error);
GDF_AVAILABLE_IN_8_0
GDF_AVAILABLE_IN_10_0
GArrowTable *
gdf_data_frame_to_table(GDFDataFrame *data_frame, GError **error);

Expand Down
52 changes: 0 additions & 52 deletions datafusion-glib/enums.c.template

This file was deleted.

41 changes: 0 additions & 41 deletions datafusion-glib/enums.h.template

This file was deleted.

39 changes: 25 additions & 14 deletions datafusion-glib/error.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,30 +27,41 @@ G_BEGIN_DECLS

/**
* GDFError:
* @GDF_ERROR_ARROW:
* @GDF_ERROR_PARQUET:
* @GDF_ERROR_AVRO:
* @GDF_ERROR_IO:
* @GDF_ERROR_SQL:
* @GDF_ERROR_NOT_IMPLEMENTED:
* @GDF_ERROR_INTERNAL:
* @GDF_ERROR_PLAN:
* @GDF_ERROR_SCHEMA:
* @GDF_ERROR_EXECUTION:
* @GDF_ERROR_RESOURCES_EXHAUSTED:
* @GDF_ERROR_EXTERNAL:
* @GDF_ERROR_JIT:
* @GDF_ERROR_ARROW: Error returned by arrow crate.
* @GDF_ERROR_PARQUET: Error returned by parquet crate.
* @GDF_ERROR_AVRO: Error returned by avro-rs crate.
* @GDF_ERROR_OBJECT_STORE: Error returned by object_store crate.
* @GDF_ERROR_IO: Error associated to I/O operations and associated traits.
* @GDF_ERROR_SQL: Error returned when SQL is syntactically incorrect.
* @GDF_ERROR_NOT_IMPLEMENTED: Error returned on a branch that we know it is
* possible but to which we still have no implementation for.
* Often, these errors are tracked in our issue tracker.
* @GDF_ERROR_INTERNAL: Error returned as a consequence of an error in
* DataFusion. This error should not happen in normal usage of DataFusion.
* @GDF_ERROR_PLAN: This error happens whenever a plan is not valid. Examples
* include impossible casts.
* @GDF_ERROR_SCHEMA: This error happens with schema-related errors, such as
* schema inference not possible and non-unique column names.
* @GDF_ERROR_EXECUTION: Error returned during execution of the query.
* Examples include files not found, errors in parsing certain types.
* @GDF_ERROR_RESOURCES_EXHAUSTED: This error is thrown when a consumer cannot
* acquire memory from the Memory Manager we can just cancel the execution
* of the partition.
* @GDF_ERROR_EXTERNAL: For example, a custom S3Error from the crate
* datafusion-objectstore-s3.
* @GDF_ERROR_JIT: Error occurs during code generation.
*
* The error codes are used by all datafusion-glib functions.
*
* They are corresponding to `DFErrorCode` values.
*
* Since: 8.0.0
* Since: 10.0.0
*/
typedef enum {
GDF_ERROR_ARROW,
GDF_ERROR_PARQUET,
GDF_ERROR_AVRO,
GDF_ERROR_OBJECT_STORE,
GDF_ERROR_IO,
GDF_ERROR_SQL,
GDF_ERROR_NOT_IMPLEMENTED,
Expand Down
14 changes: 6 additions & 8 deletions datafusion-glib/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -44,14 +44,12 @@ version_h = configure_file(input: 'version.h.in',
headers += version_h

gnome = import('gnome')
enums = gnome.mkenums('enums',
sources: headers,
identifier_prefix: 'GDF',
symbol_prefix: 'gdf',
c_template: 'enums.c.template',
h_template: 'enums.h.template',
install_dir: include_dir / 'datafusion-glib',
install_header: true)
enums = gnome.mkenums_simple('enums',
identifier_prefix: 'GDF',
install_dir: include_dir / 'datafusion-glib',
install_header: true,
sources: headers,
symbol_prefix: 'gdf')
enums_source = enums[0]
enums_header = enums[1]

Expand Down
2 changes: 1 addition & 1 deletion datafusion-glib/session-context-raw.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@

G_BEGIN_DECLS

GDF_AVAILABLE_IN_8_0
GDF_AVAILABLE_IN_10_0
GDFSessionContext *
gdf_session_context_new_raw(DFSessionContext *raw_context);

Expand Down
8 changes: 4 additions & 4 deletions datafusion-glib/session-context.c
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ gdf_session_context_class_init(GDFSessionContextClass *klass)
*
* Returns: A new session context.
*
* Since: 8.0.0
* Since: 10.0.0
*/
GDFSessionContext *
gdf_session_context_new(void)
Expand All @@ -139,7 +139,7 @@ gdf_session_context_new(void)
* Returns: (transfer full) (nullable): The executed result as
* #GDFDataFrame, %NULL on error.
*
* Since: 8.0.0
* Since: 10.0.0
*/
GDFDataFrame *
gdf_session_context_sql(GDFSessionContext *context,
Expand Down Expand Up @@ -195,7 +195,7 @@ df_arrow_array_release_destroy(gpointer array)
*
* Returns: %TRUE on success, %FALSE otherwise.
*
* Since: 8.0.0
* Since: 10.0.0
*/
gboolean
gdf_session_context_register_record_batch(GDFSessionContext *context,
Expand Down Expand Up @@ -248,7 +248,7 @@ gdf_session_context_register_record_batch(GDFSessionContext *context,
*
* Returns: %TRUE on success, %FALSE otherwise.
*
* Since: 8.0.0
* Since: 10.0.0
*/
gboolean
gdf_session_context_register_table(GDFSessionContext *context,
Expand Down
8 changes: 4 additions & 4 deletions datafusion-glib/session-context.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,21 +35,21 @@ struct _GDFSessionContextClass
GObjectClass parent_class;
};

GDF_AVAILABLE_IN_8_0
GDF_AVAILABLE_IN_10_0
GDFSessionContext *
gdf_session_context_new(void);
GDF_AVAILABLE_IN_8_0
GDF_AVAILABLE_IN_10_0
GDFDataFrame *
gdf_session_context_sql(GDFSessionContext *context,
const gchar *sql,
GError **error);
GDF_AVAILABLE_IN_8_0
GDF_AVAILABLE_IN_10_0
gboolean
gdf_session_context_register_record_batch(GDFSessionContext *context,
const gchar *name,
GArrowRecordBatch *record_batch,
GError **error);
GDF_AVAILABLE_IN_8_0
GDF_AVAILABLE_IN_10_0
gboolean
gdf_session_context_register_table(GDFSessionContext *context,
const gchar *name,
Expand Down
Loading

0 comments on commit d54bdf1

Please sign in to comment.