Skip to content

Commit

Permalink
Merge branch 'main' into dataset/fixing-async-bug
Browse files Browse the repository at this point in the history
  • Loading branch information
mapleFU committed Nov 14, 2023
2 parents 9ba33bf + f3ec224 commit d38d982
Show file tree
Hide file tree
Showing 947 changed files with 26,665 additions and 6,082 deletions.
1 change: 1 addition & 0 deletions .asf.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ github:
- davisusanibar
- felipecrv
- js8544
- amoeba

notifications:
commits: [email protected]
Expand Down
2 changes: 1 addition & 1 deletion .env
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ ULIMIT_CORE=-1
ALMALINUX=8
ALPINE_LINUX=3.16
DEBIAN=11
FEDORA=35
FEDORA=38
UBUNTU=20.04

# Default versions for various dependencies
Expand Down
23 changes: 4 additions & 19 deletions .github/workflows/java.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,32 +49,17 @@ env:

jobs:

debian:
name: ${{ matrix.title }}
ubuntu:
name: AMD64 Ubuntu 22.04 Java JDK ${{ matrix.jdk }} Maven ${{ matrix.maven }}
runs-on: ubuntu-latest
if: ${{ !contains(github.event.pull_request.title, 'WIP') }}
timeout-minutes: 30
strategy:
fail-fast: false
matrix:
jdk: [8, 11, 17, 21]
include:
- jdk: 8
title: AMD64 Debian 9 Java JDK 8 Maven 3.5.4
maven: 3.5.4
image: debian-java
- jdk: 11
title: AMD64 Debian 9 Java JDK 11 Maven 3.6.2
maven: 3.6.2
image: debian-java
- jdk: 17
title: AMD64 Ubuntu 22.04 Java JDK 17 Maven 3.9.4
maven: 3.9.4
image: eclipse-java
- jdk: 21
title: AMD64 Ubuntu 22.04 Java JDK 21 Maven 3.9.4
maven: 3.9.4
image: eclipse-java
maven: [3.9.5]
image: [java]
env:
JDK: ${{ matrix.jdk }}
MAVEN: ${{ matrix.maven }}
Expand Down
7 changes: 4 additions & 3 deletions c_glib/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,8 @@ GLib (replace the version number in the following commands with the
one you use):

```console
$ wget 'https://www.apache.org/dyn/closer.lua?action=download&filename=arrow/arrow-12.0.0/apache-arrow-12.0.0.tar.gz'
$ wget 'https://www.apache.org/dyn/closer.lua?action=download&filename=arrow/arrow-12.0.0/apache-arrow-12.0.0.tar.gz' \
--output-document apache-arrow-12.0.0.tar.gz
$ tar xf apache-arrow-12.0.0.tar.gz
$ cd apache-arrow-12.0.0
```
Expand All @@ -81,7 +82,7 @@ required packages.
macOS:

```console
$ brew bundle
$ brew bundle --file=c_glib/Brewfile
$ meson setup c_glib.build c_glib --buildtype=release
$ meson compile -C c_glib.build
$ sudo meson install -C c_glib.build
Expand Down Expand Up @@ -127,7 +128,7 @@ $ sudo pip3 install meson
On macOS with [Homebrew](https://brew.sh/):

```console
$ brew bundle
$ brew bundle --file=c_glib/Brewfile
```

You can build and install Arrow GLib by the followings:
Expand Down
23 changes: 23 additions & 0 deletions c_glib/arrow-glib/version.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,15 @@
# define GARROW_UNAVAILABLE(major, minor) G_UNAVAILABLE(major, minor)
#endif

/**
* GARROW_VERSION_15_0:
*
* You can use this macro value for compile time API version check.
*
* Since: 15.0.0
*/
#define GARROW_VERSION_15_0 G_ENCODE_VERSION(15, 0)

/**
* GARROW_VERSION_14_0:
*
Expand Down Expand Up @@ -346,6 +355,20 @@

#define GARROW_AVAILABLE_IN_ALL

#if GARROW_VERSION_MIN_REQUIRED >= GARROW_VERSION_15_0
# define GARROW_DEPRECATED_IN_15_0 GARROW_DEPRECATED
# define GARROW_DEPRECATED_IN_15_0_FOR(function) GARROW_DEPRECATED_FOR(function)
#else
# define GARROW_DEPRECATED_IN_15_0
# define GARROW_DEPRECATED_IN_15_0_FOR(function)
#endif

#if GARROW_VERSION_MAX_ALLOWED < GARROW_VERSION_15_0
# define GARROW_AVAILABLE_IN_15_0 GARROW_UNAVAILABLE(15, 0)
#else
# define GARROW_AVAILABLE_IN_15_0
#endif

#if GARROW_VERSION_MIN_REQUIRED >= GARROW_VERSION_14_0
# define GARROW_DEPRECATED_IN_14_0 GARROW_DEPRECATED
# define GARROW_DEPRECATED_IN_14_0_FOR(function) GARROW_DEPRECATED_FOR(function)
Expand Down
4 changes: 4 additions & 0 deletions c_glib/doc/gandiva-glib/gandiva-glib-docs.xml
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,10 @@
<title>Index of deprecated API</title>
<xi:include href="xml/api-index-deprecated.xml"><xi:fallback /></xi:include>
</index>
<index id="api-index-15-0-0" role="15.0.0">
<title>Index of new symbols in 15.0.0</title>
<xi:include href="xml/api-index-15.0.0.xml"><xi:fallback /></xi:include>
</index>
<index id="api-index-4-0-0" role="4.0.0">
<title>Index of new symbols in 4.0.0</title>
<xi:include href="xml/api-index-4.0.0.xml"><xi:fallback /></xi:include>
Expand Down
118 changes: 101 additions & 17 deletions c_glib/gandiva-glib/function-registry.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@
*/

#include <gandiva/function_registry.h>
#include <gandiva-glib/function-registry.h>

#include <gandiva-glib/function-registry.hpp>
#include <gandiva-glib/function-signature.hpp>
#include <gandiva-glib/native-function.hpp>

Expand All @@ -34,18 +34,86 @@ G_BEGIN_DECLS
* Since: 0.14.0
*/

G_DEFINE_TYPE(GGandivaFunctionRegistry,
ggandiva_function_registry,
G_TYPE_OBJECT)
struct GGandivaFunctionRegistryPrivate {
std::shared_ptr<gandiva::FunctionRegistry> function_registry;
};

enum {
PROP_FUNCTION_REGISTRY = 1,
};

G_DEFINE_TYPE_WITH_PRIVATE(GGandivaFunctionRegistry,
ggandiva_function_registry,
G_TYPE_OBJECT)

#define GGANDIVA_FUNCTION_REGISTRY_GET_PRIVATE(object) \
static_cast<GGandivaFunctionRegistryPrivate *>( \
ggandiva_function_registry_get_instance_private( \
GGANDIVA_FUNCTION_REGISTRY(object)))

static void
ggandiva_function_registry_finalize(GObject *object)
{
auto priv = GGANDIVA_FUNCTION_REGISTRY_GET_PRIVATE(object);
priv->function_registry.~shared_ptr();
G_OBJECT_CLASS(ggandiva_function_registry_parent_class)->finalize(object);
}

static void
ggandiva_function_registry_set_property(GObject *object,
guint prop_id,
const GValue *value,
GParamSpec *pspec)
{
auto priv = GGANDIVA_FUNCTION_REGISTRY_GET_PRIVATE(object);

switch (prop_id) {
case PROP_FUNCTION_REGISTRY:
priv->function_registry =
*static_cast<std::shared_ptr<gandiva::FunctionRegistry> *>(
g_value_get_pointer(value));
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec);
break;
}
}

static void
ggandiva_function_registry_init(GGandivaFunctionRegistry *object)
{
auto priv = GGANDIVA_FUNCTION_REGISTRY_GET_PRIVATE(object);
new(&priv->function_registry) std::shared_ptr<gandiva::FunctionRegistry>;
}

static void
ggandiva_function_registry_class_init(GGandivaFunctionRegistryClass *klass)
{
auto gobject_class = G_OBJECT_CLASS(klass);
gobject_class->finalize = ggandiva_function_registry_finalize;
gobject_class->set_property = ggandiva_function_registry_set_property;

GParamSpec *spec;
spec = g_param_spec_pointer("function-registry",
"Function registry",
"The raw std::shared_ptr<gandiva::FunctionRegistry> *",
static_cast<GParamFlags>(G_PARAM_WRITABLE |
G_PARAM_CONSTRUCT_ONLY));
g_object_class_install_property(gobject_class, PROP_FUNCTION_REGISTRY, spec);
}

/**
* ggandiva_function_registry_default:
*
* Returns: (transfer full): The process-wide default function registry.
*
* Since: 15.0.0
*/
GGandivaFunctionRegistry *
ggandiva_function_registry_default(void)
{
auto gandiva_function_registry = gandiva::default_function_registry();
return ggandiva_function_registry_new_raw(&gandiva_function_registry);
}

/**
Expand All @@ -58,7 +126,8 @@ ggandiva_function_registry_class_init(GGandivaFunctionRegistryClass *klass)
GGandivaFunctionRegistry *
ggandiva_function_registry_new(void)
{
return GGANDIVA_FUNCTION_REGISTRY(g_object_new(GGANDIVA_TYPE_FUNCTION_REGISTRY, NULL));
auto gandiva_function_registry = std::make_shared<gandiva::FunctionRegistry>();
return ggandiva_function_registry_new_raw(&gandiva_function_registry);
}

/**
Expand All @@ -75,15 +144,16 @@ GGandivaNativeFunction *
ggandiva_function_registry_lookup(GGandivaFunctionRegistry *function_registry,
GGandivaFunctionSignature *function_signature)
{
gandiva::FunctionRegistry gandiva_function_registry;
auto gandiva_function_registry =
ggandiva_function_registry_get_raw(function_registry);
auto gandiva_function_signature =
ggandiva_function_signature_get_raw(function_signature);
auto gandiva_native_function =
gandiva_function_registry.LookupSignature(*gandiva_function_signature);
gandiva_function_registry->LookupSignature(*gandiva_function_signature);
if (gandiva_native_function) {
return ggandiva_native_function_new_raw(gandiva_native_function);
} else {
return NULL;
return nullptr;
}
}

Expand All @@ -99,18 +169,32 @@ ggandiva_function_registry_lookup(GGandivaFunctionRegistry *function_registry,
GList *
ggandiva_function_registry_get_native_functions(GGandivaFunctionRegistry *function_registry)
{
gandiva::FunctionRegistry gandiva_function_registry;

auto gandiva_function_registry =
ggandiva_function_registry_get_raw(function_registry);
GList *native_functions = nullptr;
for (auto gandiva_native_function = gandiva_function_registry.begin();
gandiva_native_function != gandiva_function_registry.end();
++gandiva_native_function) {
auto native_function = ggandiva_native_function_new_raw(gandiva_native_function);
for (const auto &gandiva_native_function : *gandiva_function_registry) {
auto native_function = ggandiva_native_function_new_raw(&gandiva_native_function);
native_functions = g_list_prepend(native_functions, native_function);
}
native_functions = g_list_reverse(native_functions);

return native_functions;
return g_list_reverse(native_functions);
}

G_END_DECLS

GGandivaFunctionRegistry *
ggandiva_function_registry_new_raw(
std::shared_ptr<gandiva::FunctionRegistry> *gandiva_function_registry)
{
return GGANDIVA_FUNCTION_REGISTRY(
g_object_new(GGANDIVA_TYPE_FUNCTION_REGISTRY,
"function-registry", gandiva_function_registry,
nullptr));
}

std::shared_ptr<gandiva::FunctionRegistry>
ggandiva_function_registry_get_raw(GGandivaFunctionRegistry *function_registry)
{
auto priv = GGANDIVA_FUNCTION_REGISTRY_GET_PRIVATE(function_registry);
return priv->function_registry;
}

2 changes: 2 additions & 0 deletions c_glib/gandiva-glib/function-registry.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ struct _GGandivaFunctionRegistryClass
GObjectClass parent_class;
};

GARROW_AVAILABLE_IN_15_0
GGandivaFunctionRegistry *ggandiva_function_registry_default(void);
GGandivaFunctionRegistry *ggandiva_function_registry_new(void);
GGandivaNativeFunction *
ggandiva_function_registry_lookup(GGandivaFunctionRegistry *function_registry,
Expand Down
30 changes: 30 additions & 0 deletions c_glib/gandiva-glib/function-registry.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/

#pragma once

#include <gandiva/function_registry.h>

#include <gandiva-glib/function-registry.h>

GGandivaFunctionRegistry *
ggandiva_function_registry_new_raw(
std::shared_ptr<gandiva::FunctionRegistry> *gandiva_function_registry);
std::shared_ptr<gandiva::FunctionRegistry>
ggandiva_function_registry_get_raw(GGandivaFunctionRegistry *function_registry);
2 changes: 1 addition & 1 deletion c_glib/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ project('arrow-glib', 'c', 'cpp',
'cpp_std=c++17',
])

version = '14.0.0-SNAPSHOT'
version = '15.0.0-SNAPSHOT'
if version.endswith('-SNAPSHOT')
version_numbers = version.split('-')[0].split('.')
version_tag = version.split('-')[1]
Expand Down
2 changes: 1 addition & 1 deletion c_glib/test/gandiva/test-function-registry.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class TestGandivaFunctionRegistry < Test::Unit::TestCase

def setup
omit("Gandiva is required") unless defined?(::Gandiva)
@registry = Gandiva::FunctionRegistry.new
@registry = Gandiva::FunctionRegistry.default
end

sub_test_case("lookup") do
Expand Down
2 changes: 1 addition & 1 deletion c_glib/test/gandiva/test-native-function.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class TestGandivaNativeFunction < Test::Unit::TestCase

def setup
omit("Gandiva is required") unless defined?(::Gandiva)
@registry = Gandiva::FunctionRegistry.new
@registry = Gandiva::FunctionRegistry.default
@not = lookup("not", [boolean_data_type], boolean_data_type)
@isnull = lookup("isnull", [int8_data_type], boolean_data_type)
end
Expand Down
2 changes: 1 addition & 1 deletion ci/conda_env_python.txt
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,6 @@ numpy>=1.16.6
pytest
pytest-faulthandler
pytest-lazy-fixture
s3fs>=2021.8.0
s3fs>=2023.10.0
setuptools
setuptools_scm<8.0.0
Loading

0 comments on commit d38d982

Please sign in to comment.