Skip to content

Commit

Permalink
Merge branch 'main' of https://github.com/R-JunmingChen/arrow into AR…
Browse files Browse the repository at this point in the history
…ROW-36831
  • Loading branch information
R-JunmingChen committed Aug 21, 2023
2 parents e30d33d + 6357c9f commit e64fd4e
Show file tree
Hide file tree
Showing 373 changed files with 14,740 additions and 4,649 deletions.
6 changes: 6 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,12 @@ updates:
interval: "weekly"
commit-message:
prefix: "MINOR: [CI] "
- package-ecosystem: "npm"
directory: "/js/"
schedule:
interval: "monthly"
commit-message:
prefix: "MINOR: [JS] "
- package-ecosystem: "nuget"
directory: "/csharp/"
schedule:
Expand Down
4 changes: 1 addition & 3 deletions .github/workflows/cpp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -164,8 +164,7 @@ jobs:
ARROW_HDFS: ON
ARROW_HOME: /usr/local
ARROW_JEMALLOC: ON
# TODO(kszucs): link error in the tests
ARROW_ORC: OFF
ARROW_ORC: ON
ARROW_PARQUET: ON
ARROW_S3: ON
ARROW_WITH_BROTLI: ON
Expand Down Expand Up @@ -273,7 +272,6 @@ jobs:
CMAKE_INSTALL_LIBDIR: bin
CMAKE_INSTALL_PREFIX: /usr
CMAKE_UNITY_BUILD: ON
NPROC: 3
steps:
- name: Disable Crash Dialogs
run: |
Expand Down
7 changes: 5 additions & 2 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,17 +30,20 @@ env:
jobs:

complete:
name: AMD64 Ubuntu 20.04 Complete Documentation
name: AMD64 Ubuntu 22.04 Complete Documentation
runs-on: ubuntu-latest
if: ${{ !contains(github.event.pull_request.title, 'WIP') }}
timeout-minutes: 150
env:
UBUNTU: "20.04"
UBUNTU: "22.04"
steps:
- name: Checkout Arrow
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Free up disk space
run: |
ci/scripts/util_free_space.sh
- name: Cache Docker Volumes
uses: actions/cache@v3
with:
Expand Down
16 changes: 8 additions & 8 deletions .github/workflows/java.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ jobs:
strategy:
fail-fast: false
matrix:
jdk: [8, 11, 17, 18]
jdk: [8, 11, 17, 20]
include:
- jdk: 8
title: AMD64 Debian 9 Java JDK 8 Maven 3.5.4
Expand All @@ -66,13 +66,13 @@ jobs:
maven: 3.6.2
image: debian-java
- jdk: 17
title: AMD64 Oracle Linux Server 8.5 Java JDK 17 Maven 3.8.5
maven: 3.8.5
image: oracle-java
- jdk: 18
title: AMD64 Oracle Linux Server 8.6 Java JDK 18 Maven 3.8.5
maven: 3.8.5
image: oracle-java
title: AMD64 Ubuntu 22.04 Java JDK 17 Maven 3.9.3
maven: 3.9.3
image: eclipse-java
- jdk: 20
title: AMD64 Ubuntu 22.04 Java JDK 20 Maven 3.9.3
maven: 3.9.3
image: eclipse-java
env:
JDK: ${{ matrix.jdk }}
MAVEN: ${{ matrix.maven }}
Expand Down
146 changes: 134 additions & 12 deletions c_glib/arrow-flight-glib/client.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -166,12 +166,17 @@ gaflight_call_options_foreach_header(GAFlightCallOptions *options,
}


typedef struct GAFlightClientOptionsPrivate_ {
struct GAFlightClientOptionsPrivate {
arrow::flight::FlightClientOptions options;
} GAFlightClientOptionsPrivate;
};

enum {
PROP_DISABLE_SERVER_VERIFICATION = 1,
PROP_TLS_ROOT_CERTIFICATES = 1,
PROP_OVERRIDE_HOST_NAME,
PROP_CERTIFICATE_CHAIN,
PROP_PRIVATE_KEY,
PROP_WRITE_SIZE_LIMIT_BYTES,
PROP_DISABLE_SERVER_VERIFICATION,
};

G_DEFINE_TYPE_WITH_PRIVATE(GAFlightClientOptions,
Expand Down Expand Up @@ -202,6 +207,21 @@ gaflight_client_options_set_property(GObject *object,
auto priv = GAFLIGHT_CLIENT_OPTIONS_GET_PRIVATE(object);

switch (prop_id) {
case PROP_TLS_ROOT_CERTIFICATES:
priv->options.tls_root_certs = g_value_get_string(value);
break;
case PROP_OVERRIDE_HOST_NAME:
priv->options.override_hostname = g_value_get_string(value);
break;
case PROP_CERTIFICATE_CHAIN:
priv->options.cert_chain = g_value_get_string(value);
break;
case PROP_PRIVATE_KEY:
priv->options.private_key = g_value_get_string(value);
break;
case PROP_WRITE_SIZE_LIMIT_BYTES:
priv->options.write_size_limit_bytes = g_value_get_int64(value);
break;
case PROP_DISABLE_SERVER_VERIFICATION:
priv->options.disable_server_verification = g_value_get_boolean(value);
break;
Expand All @@ -220,6 +240,21 @@ gaflight_client_options_get_property(GObject *object,
auto priv = GAFLIGHT_CLIENT_OPTIONS_GET_PRIVATE(object);

switch (prop_id) {
case PROP_TLS_ROOT_CERTIFICATES:
g_value_set_string(value, priv->options.tls_root_certs.c_str());
break;
case PROP_OVERRIDE_HOST_NAME:
g_value_set_string(value, priv->options.override_hostname.c_str());
break;
case PROP_CERTIFICATE_CHAIN:
g_value_set_string(value, priv->options.cert_chain.c_str());
break;
case PROP_PRIVATE_KEY:
g_value_set_string(value, priv->options.private_key.c_str());
break;
case PROP_WRITE_SIZE_LIMIT_BYTES:
g_value_set_int64(value, priv->options.write_size_limit_bytes);
break;
case PROP_DISABLE_SERVER_VERIFICATION:
g_value_set_boolean(value, priv->options.disable_server_verification);
break;
Expand Down Expand Up @@ -248,6 +283,93 @@ gaflight_client_options_class_init(GAFlightClientOptionsClass *klass)

auto options = arrow::flight::FlightClientOptions::Defaults();
GParamSpec *spec;
/**
* GAFlightClientOptions:tls-root-certificates:
*
* Root certificates to use for validating server certificates.
*
* Since: 14.0.0
*/
spec = g_param_spec_string("tls-root-certificates",
nullptr,
nullptr,
options.tls_root_certs.c_str(),
static_cast<GParamFlags>(G_PARAM_READWRITE));
g_object_class_install_property(gobject_class,
PROP_TLS_ROOT_CERTIFICATES,
spec);

/**
* GAFlightClientOptions:override-host-name:
*
* Override the host name checked by TLS. Use with caution.
*
* Since: 14.0.0
*/
spec = g_param_spec_string("override-host-name",
nullptr,
nullptr,
options.override_hostname.c_str(),
static_cast<GParamFlags>(G_PARAM_READWRITE));
g_object_class_install_property(gobject_class,
PROP_OVERRIDE_HOST_NAME,
spec);

/**
* GAFlightClientOptions:certificate-chain:
*
* The client certificate to use if using Mutual TLS.
*
* Since: 14.0.0
*/
spec = g_param_spec_string("certificate-chain",
nullptr,
nullptr,
options.cert_chain.c_str(),
static_cast<GParamFlags>(G_PARAM_READWRITE));
g_object_class_install_property(gobject_class,
PROP_CERTIFICATE_CHAIN,
spec);

/**
* GAFlightClientOptions:private-key:
*
* The private key associated with the client certificate for Mutual
* TLS.
*
* Since: 14.0.0
*/
spec = g_param_spec_string("private-key",
nullptr,
nullptr,
options.private_key.c_str(),
static_cast<GParamFlags>(G_PARAM_READWRITE));
g_object_class_install_property(gobject_class,
PROP_PRIVATE_KEY,
spec);

/**
* GAFlightClientOptions:write-size-limit-bytes:
*
* A soft limit on the number of bytes to write in a single batch
* when sending Arrow data to a server.
*
* Used to help limit server memory consumption. Only enabled if
* positive. When enabled, @GARROW_ERROR_IO may be yielded.
*
* Since: 14.0.0
*/
spec = g_param_spec_int64("write-size-limit-bytes",
nullptr,
nullptr,
INT64_MIN,
INT64_MAX,
options.write_size_limit_bytes,
static_cast<GParamFlags>(G_PARAM_READWRITE));
g_object_class_install_property(gobject_class,
PROP_WRITE_SIZE_LIMIT_BYTES,
spec);

/**
* GAFlightClientOptions:disable-server-verification:
*
Expand Down Expand Up @@ -567,16 +689,14 @@ gaflight_client_do_get(GAFlightClient *client,
if (options) {
flight_options = gaflight_call_options_get_raw(options);
}
std::unique_ptr<arrow::flight::FlightStreamReader> flight_reader;
auto result = flight_client->DoGet(*flight_options, *flight_ticket);
auto status = std::move(result).Value(&flight_reader);
if (garrow::check(error,
status,
"[flight-client][do-get]")) {
return gaflight_stream_reader_new_raw(flight_reader.release());
} else {
return NULL;
if (!garrow::check(error,
result,
"[flight-client][do-get]")) {
return nullptr;
}
auto flight_reader = std::move(*result);
return gaflight_stream_reader_new_raw(flight_reader.release(), TRUE);
}


Expand All @@ -585,11 +705,13 @@ G_END_DECLS

GAFlightStreamReader *
gaflight_stream_reader_new_raw(
arrow::flight::FlightStreamReader *flight_reader)
arrow::flight::FlightStreamReader *flight_reader,
gboolean is_owner)
{
return GAFLIGHT_STREAM_READER(
g_object_new(GAFLIGHT_TYPE_STREAM_READER,
"reader", flight_reader,
"is-owner", is_owner,
NULL));
}

Expand Down
4 changes: 3 additions & 1 deletion c_glib/arrow-flight-glib/client.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,9 @@


GAFlightStreamReader *
gaflight_stream_reader_new_raw(arrow::flight::FlightStreamReader *flight_reader);
gaflight_stream_reader_new_raw(
arrow::flight::FlightStreamReader *flight_reader,
gboolean is_owner);

arrow::flight::FlightCallOptions *
gaflight_call_options_get_raw(GAFlightCallOptions *options);
Expand Down
23 changes: 18 additions & 5 deletions c_glib/arrow-flight-glib/common.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1223,10 +1223,12 @@ gaflight_stream_chunk_get_metadata(GAFlightStreamChunk *chunk)

typedef struct GAFlightRecordBatchReaderPrivate_ {
arrow::flight::MetadataRecordBatchReader *reader;
bool is_owner;
} GAFlightRecordBatchReaderPrivate;

enum {
PROP_READER = 1,
PROP_IS_OWNER,
};

G_DEFINE_TYPE_WITH_PRIVATE(GAFlightRecordBatchReader,
Expand All @@ -1242,9 +1244,9 @@ static void
gaflight_record_batch_reader_finalize(GObject *object)
{
auto priv = GAFLIGHT_RECORD_BATCH_READER_GET_PRIVATE(object);

delete priv->reader;

if (priv->is_owner) {
delete priv->reader;
}
G_OBJECT_CLASS(gaflight_info_parent_class)->finalize(object);
}

Expand All @@ -1262,6 +1264,9 @@ gaflight_record_batch_reader_set_property(GObject *object,
static_cast<arrow::flight::MetadataRecordBatchReader *>(
g_value_get_pointer(value));
break;
case PROP_IS_OWNER:
priv->is_owner = g_value_get_boolean(value);
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec);
break;
Expand All @@ -1283,11 +1288,19 @@ gaflight_record_batch_reader_class_init(GAFlightRecordBatchReaderClass *klass)

GParamSpec *spec;
spec = g_param_spec_pointer("reader",
"Reader",
"The raw arrow::flight::MetadataRecordBatchReader *",
nullptr,
nullptr,
static_cast<GParamFlags>(G_PARAM_WRITABLE |
G_PARAM_CONSTRUCT_ONLY));
g_object_class_install_property(gobject_class, PROP_READER, spec);

spec = g_param_spec_boolean("is-owner",
nullptr,
nullptr,
TRUE,
static_cast<GParamFlags>(G_PARAM_WRITABLE |
G_PARAM_CONSTRUCT_ONLY));
g_object_class_install_property(gobject_class, PROP_IS_OWNER, spec);
}

/**
Expand Down
Loading

0 comments on commit e64fd4e

Please sign in to comment.