mirror of
https://github.com/rustfs/rustfs.git
synced 2026-08-27 15:37:02 +00:00
fix(s3select): validate scan_range protocol and parquet overlap (#3176)
* fix(s3select): enforce scan range protocol and parquet overlap * fix(s3select): select row groups by start offset --------- Co-authored-by: houseme <housemecn@gmail.com>
This commit is contained in:
@@ -15,7 +15,7 @@
|
||||
use std::sync::Arc;
|
||||
|
||||
use datafusion::common::Result as DFResult;
|
||||
use datafusion::datasource::listing::ListingTable;
|
||||
use datafusion::datasource::TableProvider;
|
||||
|
||||
use crate::data_source::table_source::TableHandle;
|
||||
|
||||
@@ -25,7 +25,7 @@ use super::TableHandleProvider;
|
||||
pub struct BaseTableProvider {}
|
||||
|
||||
impl TableHandleProvider for BaseTableProvider {
|
||||
fn build_table_handle(&self, provider: Arc<ListingTable>) -> DFResult<TableHandle> {
|
||||
Ok(TableHandle::External(provider))
|
||||
fn build_table_handle(&self, provider: Arc<dyn TableProvider>) -> DFResult<TableHandle> {
|
||||
Ok(provider.into())
|
||||
}
|
||||
}
|
||||
|
||||
@@ -17,7 +17,7 @@ use std::sync::Arc;
|
||||
use async_trait::async_trait;
|
||||
use datafusion::arrow::datatypes::DataType;
|
||||
use datafusion::common::Result as DFResult;
|
||||
use datafusion::datasource::listing::ListingTable;
|
||||
use datafusion::datasource::TableProvider;
|
||||
use datafusion::logical_expr::var_provider::is_system_variables;
|
||||
use datafusion::logical_expr::{AggregateUDF, ScalarUDF, TableSource, WindowUDF};
|
||||
use datafusion::variable::VarType;
|
||||
@@ -39,11 +39,11 @@ pub trait ContextProviderExtension: ContextProvider {
|
||||
pub type TableHandleProviderRef = Arc<dyn TableHandleProvider + Send + Sync>;
|
||||
|
||||
pub trait TableHandleProvider {
|
||||
fn build_table_handle(&self, provider: Arc<ListingTable>) -> DFResult<TableHandle>;
|
||||
fn build_table_handle(&self, provider: Arc<dyn TableProvider>) -> DFResult<TableHandle>;
|
||||
}
|
||||
|
||||
pub struct MetadataProvider {
|
||||
provider: Arc<ListingTable>,
|
||||
provider: Arc<dyn TableProvider>,
|
||||
session: SessionCtx,
|
||||
config_options: ConfigOptions,
|
||||
func_manager: FuncMetaManagerRef,
|
||||
@@ -53,7 +53,7 @@ pub struct MetadataProvider {
|
||||
impl MetadataProvider {
|
||||
#[allow(clippy::too_many_arguments)]
|
||||
pub fn new(
|
||||
provider: Arc<ListingTable>,
|
||||
provider: Arc<dyn TableProvider>,
|
||||
current_session_table_provider: TableHandleProviderRef,
|
||||
func_manager: FuncMetaManagerRef,
|
||||
session: SessionCtx,
|
||||
|
||||
Reference in New Issue
Block a user