Skip to content

Commit

Permalink
minor fixes and reafcatoring (#333)
Browse files Browse the repository at this point in the history
* code refactoring
supports partial aggregate skipping
fix incorrect assertion when converting concat_ws function
fix ffi "not all nodes and buffers were consumed" issues

* supports nested type hashing

supports nested type array() function

* use arrow snapshot version

---------

Co-authored-by: zhangli20 <[email protected]>
  • Loading branch information
richox and zhangli20 authored Nov 28, 2023
1 parent 704d9fe commit 50fd3d0
Show file tree
Hide file tree
Showing 119 changed files with 3,011 additions and 2,559 deletions.
47 changes: 24 additions & 23 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ strip = false

[profile.pre]
inherits = "release"
incremental = true
#incremental = true
opt-level = 1
lto = false
codegen-units = 16
Expand Down
3 changes: 3 additions & 0 deletions dev/mvn-build-helper/assembly/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,9 @@
<exclude>org/apache/commons/codec/**/*</exclude>
<exclude>org/apache/commons/compress/**/*</exclude>
<exclude>org/slf4j/**/*</exclude>
<excludes>META-INF/*.SF</excludes>
<excludes>META-INF/*.DSA</excludes>
<excludes>META-INF/*.RSA</excludes>
</excludes>
</filter>
<filter>
Expand Down
75 changes: 75 additions & 0 deletions native-engine/blaze-jni-bridge/src/conf.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
// Copyright 2022 The Blaze Authors
//
// Licensed 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.

use datafusion::common::Result;

use crate::{jni_call_static, jni_new_string};

macro_rules! define_conf {
($conftype:ty, $name:ident) => {
#[allow(non_camel_case_types)]
pub struct $name;
impl $conftype for $name {
fn key(&self) -> &'static str {
stringify!($name)
}
}
};
}

define_conf!(IntConf, BATCH_SIZE);
define_conf!(DoubleConf, MEMORY_FRACTION);
define_conf!(BooleanConf, SMJ_INEQUALITY_JOIN_ENABLE);
define_conf!(BooleanConf, BHJ_FALLBACKS_TO_SMJ_ENABLE);
define_conf!(IntConf, BHJ_FALLBACKS_TO_SMJ_ROWS_THRESHOLD);
define_conf!(IntConf, BHJ_FALLBACKS_TO_SMJ_MEM_THRESHOLD);
define_conf!(BooleanConf, CASE_CONVERT_FUNCTIONS_ENABLE);
define_conf!(IntConf, UDF_WRAPPER_NUM_THREADS);
define_conf!(BooleanConf, INPUT_BATCH_STATISTICS_ENABLE);
define_conf!(BooleanConf, IGNORE_CORRUPTED_FILES);
define_conf!(BooleanConf, PARTIAL_AGG_SKIPPING_ENABLE);
define_conf!(DoubleConf, PARTIAL_AGG_SKIPPING_RATIO);
define_conf!(IntConf, PARTIAL_AGG_SKIPPING_MIN_ROWS);

pub trait BooleanConf {
fn key(&self) -> &'static str;
fn value(&self) -> Result<bool> {
let key = jni_new_string!(self.key())?;
jni_call_static!(BlazeConf.booleanConf(key.as_obj()) -> bool)
}
}

pub trait IntConf {
fn key(&self) -> &'static str;
fn value(&self) -> Result<i32> {
let key = jni_new_string!(self.key())?;
jni_call_static!(BlazeConf.intConf(key.as_obj()) -> i32)
}
}

pub trait LongConf {
fn key(&self) -> &'static str;
fn value(&self) -> Result<i64> {
let key = jni_new_string!(self.key())?;
jni_call_static!(BlazeConf.longConf(key.as_obj()) -> i64)
}
}

pub trait DoubleConf {
fn key(&self) -> &'static str;
fn value(&self) -> Result<f64> {
let key = jni_new_string!(self.key())?;
jni_call_static!(BlazeConf.doubleConf(key.as_obj()) -> f64)
}
}
Loading

0 comments on commit 50fd3d0

Please sign in to comment.