Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
47 commits
Select commit Hold shift + click to select a range
20fc596
Read and display parquet files schema for relational data source
juliacher Mar 13, 2026
282165d
Update licenses
juliacher Mar 13, 2026
4604eab
Merge branch 'master' into parquet-adapter
juliacher Mar 13, 2026
ad6747e
Support data read, filter, projection
juliacher Mar 17, 2026
f62d11a
create Unit Tests, store nested data in JSON format
juliacher Mar 18, 2026
2befdeb
Implement Scannable flavor
juliacher Mar 25, 2026
00fd300
Implement filter push down, fix flavor issue
juliacher Mar 25, 2026
3dbd127
add document support, improve relational filter pushdown
juliacher Mar 31, 2026
9ac86ec
add comments
juliacher Mar 31, 2026
276b944
split relational and document code into two data sources and implemen…
juliacher Apr 6, 2026
a34c931
add documentation and comments
juliacher Apr 7, 2026
c37f727
Workflow - Extract Parquet
juliacher Apr 8, 2026
c307926
Workflow - Load Parquet
juliacher Apr 11, 2026
7f318a4
Workflow - extract multiple parquet files
juliacher Apr 11, 2026
7491378
Workflow - extract multiple parquet files
juliacher Apr 16, 2026
8fde060
workflow documentation
juliacher Apr 16, 2026
7dc26d0
nested fields presentation
juliacher Apr 21, 2026
c0e034c
nested fields presentation
juliacher Apr 21, 2026
4a29995
nested fields filtering
juliacher Apr 24, 2026
1d2f20a
add synthetic fields to build relations with nested tables
juliacher Apr 24, 2026
6dd8299
add support for adapter statistics
juliacher Apr 27, 2026
a2d2f84
add logical filters and IN filter
juliacher Apr 27, 2026
8ec74f9
add logical filters and IN filter - documentation and fixes
juliacher May 2, 2026
54309bf
add logical filters and IN filter - documentation and fixes
juliacher May 3, 2026
3325fb3
support root-child join on adapter level
juliacher May 8, 2026
be0ebd2
support multi files tables and partitions
juliacher May 9, 2026
96bfe99
fix adapter filters usage
juliacher May 9, 2026
2cd4b2f
fix limit for joins
juliacher May 11, 2026
acf3fd1
fix joins bug: E_CALC
juliacher May 11, 2026
b7385df
refactor parquet planning rules
juliacher May 14, 2026
173c63f
add support for filters that are not part of the projection.
juliacher May 15, 2026
8481fd4
add support for filtering source files based on column statistics
juliacher May 16, 2026
9ea733d
add documentation and comments to joins and file pruning developments
juliacher May 18, 2026
d322f3d
fix bugs in document flow and workflow
juliacher May 26, 2026
2dbcfbf
add support for aggregations push down to adapter
juliacher Jun 8, 2026
7e0239c
Add separate columns for primitive nested filed in flat mode
juliacher Jun 9, 2026
0551330
Add separate columns for primitive nested filed in flat mode
juliacher Jun 9, 2026
a8a2f54
add unit tests
juliacher Jun 9, 2026
81d5f44
fix filter support in document adapter - MQL queries
juliacher Jun 12, 2026
5ba6e0c
benchmarks specification, queries, scripts, results
juliacher Jun 14, 2026
94fa6d4
aggregation optimizations for document, benchmarks
juliacher Jun 15, 2026
ff8b35e
benchmarks, bug fixes
juliacher Jun 28, 2026
5e16663
benchmarks, result analysis, bug fixes
juliacher Jun 28, 2026
381b7fc
benchmark documentation
juliacher Jun 29, 2026
92b070e
benchmark - add std and welsh test
juliacher Jul 3, 2026
0cf7ac5
update documentation
juliacher Jul 11, 2026
9b0de05
delete unused files
juliacher Jul 11, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,9 @@ private PolyphenyHomeDirManager() {

public static PolyphenyHomeDirManager setModeAndGetInstance( RunMode mode ) {
if ( PolyphenyHomeDirManager.mode != null ) {
if ( PolyphenyHomeDirManager.mode == mode ) {
return PolyphenyHomeDirManager.getInstance();
}
throw new RuntimeException( "Could not set the mode." );
}
PolyphenyHomeDirManager.mode = mode;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
/*
* Copyright 2019-2026 The Polypheny Project
*
* 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.
*/

package org.polypheny.db.adapter.statistics;


import java.util.Optional;
import org.polypheny.db.catalog.entity.logical.LogicalColumn;


/**
* Interface for metadata-backed statistics.
*/
public interface AdapterStatisticsProvider {

default Optional<ProvidedEntityStatistics> getEntityStatistics( long logicalEntityId ) {
return Optional.empty();
}


default Optional<ProvidedColumnStatistics> getColumnStatistics( LogicalColumn column, int uniqueValueLimit ) {
return Optional.empty();
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
/*
* Copyright 2019-2026 The Polypheny Project
*
* 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.
*/

package org.polypheny.db.adapter.statistics;


import java.util.List;
import javax.annotation.Nullable;
import org.polypheny.db.type.entity.PolyValue;


/**
* Column statistics supplied directly by an adapter.
*
* @param count estimated values count, null if unavailable
* @param min minimum value, null if unavailable
* @param max maximum value, null if unavailable
* @param uniqueValues bounded unique values, empty if unavailable
* @param full whether the unique value set is known to be incomplete
*/
public record ProvidedColumnStatistics(
@Nullable Long count,
@Nullable PolyValue min,
@Nullable PolyValue max,
List<PolyValue> uniqueValues,
boolean full ) {

public ProvidedColumnStatistics {
uniqueValues = uniqueValues == null ? List.of() : List.copyOf( uniqueValues );
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
/*
* Copyright 2019-2026 The Polypheny Project
*
* 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.
*/

package org.polypheny.db.adapter.statistics;


import javax.annotation.Nullable;


/**
* Entity statistics supplied directly by an adapter.
*
* @param rowCount row count, or {@code null} if unavailable
*/
public record ProvidedEntityStatistics(
@Nullable Long rowCount ) {

}
30 changes: 27 additions & 3 deletions dbms/src/main/java/org/polypheny/db/ddl/DdlManagerImpl.java
Original file line number Diff line number Diff line change
Expand Up @@ -215,12 +215,13 @@ public void createStore( String uniqueName, String adapterName, AdapterType adap
public void createSource( Transaction transaction, String uniqueName, String adapterName, long namespace, AdapterType adapterType, Map<String, String> config, DeployMode mode ) {
uniqueName = uniqueName.toLowerCase();
DataSource<?> adapter = (DataSource<?>) AdapterManager.getInstance().addAdapter( catalog, adapterName, uniqueName, adapterType, mode, config );
namespace = adapter.getCurrentNamespace() == null ? namespace : adapter.getCurrentNamespace().getId(); // TODO: clean implementation. Sources should either create their own namespace or there should be default namespaces for different models.
long sourceNamespace = adapter.getCurrentNamespace() == null ? namespace : adapter.getCurrentNamespace().getId(); // TODO: clean implementation. Sources should either create their own namespace or there should be default namespaces for different models.
// Support more than one data model per adapter
if ( adapter.supportsRelational() ) {
createRelationalSource( transaction, adapter, namespace );
createRelationalSource( transaction, adapter, resolveSourceNamespace( uniqueName, sourceNamespace, DataModel.RELATIONAL ) );
}
if ( adapter.supportsDocument() ) {
createDocumentSource( adapter, namespace );
createDocumentSource( adapter, resolveSourceNamespace( uniqueName, sourceNamespace, DataModel.DOCUMENT ) );
}
if ( adapter.supportsGraph() ) {
// TODO: implement graph source creation
Expand All @@ -230,6 +231,29 @@ public void createSource( Transaction transaction, String uniqueName, String ada
}


/**
* Support more than one data model per adapter
* if there is existing namespace for the provided adapter model (RELATIONAL\DOCUMENT) - use it
* otherwise create appropriate namespace
* @param uniqueName - adapter name
* @param namespaceId - namesapce id of adapter to check
* @param model - RELATIONAL\DOCUMENT
* @return namespace id
*/
private long resolveSourceNamespace( String uniqueName, long namespaceId, DataModel model ) {
LogicalNamespace namespace = catalog.getSnapshot().getNamespace( namespaceId ).orElseThrow();
if ( namespace.dataModel == model ) {
return namespaceId;
}

String sourceNamespaceName = uniqueName + "_" + model.name().toLowerCase();
return catalog.getSnapshot().getNamespace( sourceNamespaceName )
.filter( ns -> ns.dataModel == model )
.map( ns -> ns.id )
.orElseGet( () -> createNamespace( sourceNamespaceName, model, true, false, false, null ) );
}


private void createDocumentSource( DataSource<?> adapter, long namespace ) {
List<ExportedDocument> exportedCollections;
try {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@
import org.polypheny.db.catalog.entity.physical.PhysicalEntity;
import org.polypheny.db.catalog.exceptions.GenericRuntimeException;
import org.polypheny.db.catalog.logistic.DataModel;
import org.polypheny.db.catalog.logistic.PartitionType;
import org.polypheny.db.config.RuntimeConfig;
import org.polypheny.db.information.InformationPolyAlg.PlanType;
import org.polypheny.db.interpreter.BindableConvention;
Expand All @@ -104,6 +105,8 @@
import org.polypheny.db.processing.shuttles.QueryParameterizer;
import org.polypheny.db.processing.util.Plan;
import org.polypheny.db.processing.util.ProposedImplementations;
import org.polypheny.db.partition.PartitionManagerFactory;
import org.polypheny.db.partition.properties.PartitionProperty;
import org.polypheny.db.rex.RexBuilder;
import org.polypheny.db.rex.RexDynamicParam;
import org.polypheny.db.rex.RexIndexRef;
Expand Down Expand Up @@ -1204,7 +1207,7 @@ private LogicalQueryInformation analyzeQueryAndPrepareMonitoring( Statement stat

// Get partitions of logical information

Map<Long, List<Long>> accessedPartitions = extractPartitions( logicalRoot.alg.getEntities() );
Map<Long, List<Long>> accessedPartitions = extractPartitions( logicalRoot.alg.getEntities(), analyzer.partitionValueFilterPerScan );

// Build queryClass from query-name and partitions.
String queryHash = analyzer.getQueryName() + accessedPartitions;
Expand All @@ -1227,11 +1230,11 @@ private LogicalQueryInformation analyzeQueryAndPrepareMonitoring( Statement stat
}


private Map<Long, List<Long>> extractPartitions( Set<Entity> entities ) {
private Map<Long, List<Long>> extractPartitions( Set<Entity> entities, Map<Long, Set<String>> partitionValueFilterPerScan ) {
Map<Long, List<Long>> map = new HashMap<>();
for ( Entity entity : entities ) {
if ( entity.isLogical() ) {
map.computeIfAbsent( entity.getId(), k -> new ArrayList<>() ).addAll( Catalog.snapshot().alloc().getPartitionsFromLogical( entity.getId() ).stream().map( p -> p.id ).toList() );
map.computeIfAbsent( entity.getId(), k -> new ArrayList<>() ).addAll( extractPartitionsForLogicalEntity( entity, partitionValueFilterPerScan ) );
} else if ( entity.isAllocation() ) {
map.computeIfAbsent( ((AllocationEntity) entity).getLogicalId(), k -> new ArrayList<>() ).add( ((AllocationEntity) entity).getPartitionId() );
} else if ( entity.isPhysical() ) {
Expand All @@ -1242,6 +1245,32 @@ private Map<Long, List<Long>> extractPartitions( Set<Entity> entities ) {
}


private List<Long> extractPartitionsForLogicalEntity( Entity entity, Map<Long, Set<String>> partitionValueFilterPerScan ) {
List<Long> allPartitions = Catalog.snapshot().alloc().getPartitionsFromLogical( entity.getId() ).stream().map( p -> p.id ).toList();
Set<String> partitionValues = partitionValueFilterPerScan.get( entity.getId() );
if ( partitionValues == null || partitionValues.isEmpty() ) {
return allPartitions;
}

PartitionProperty property = Catalog.snapshot().alloc().getPartitionProperty( entity.getId() ).orElse( null );
if ( property == null || property.partitionType == PartitionType.NONE ) {
return allPartitions;
}

LogicalTable table = Catalog.snapshot().rel().getTable( entity.getId() ).orElse( null );
if ( table == null ) {
return allPartitions;
}

List<Long> selectedPartitions = partitionValues.stream()
.map( value -> PartitionManagerFactory.getInstance().getPartitionManager( property.partitionType ).getTargetPartitionId( table, property, value ) )
.filter( partitionId -> partitionId >= 0 )
.distinct()
.toList();
return selectedPartitions.isEmpty() ? allPartitions : selectedPartitions;
}


private void prepareMonitoring( Statement statement, AlgRoot logicalRoot, boolean isAnalyze, boolean isSubquery, LogicalQueryInformation queryInformation ) {

// Initialize Monitoring
Expand Down
2 changes: 2 additions & 0 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -91,3 +91,5 @@ typesafe_config_version = 1.2.1
unirest_version = 3.14.5
web3j_version = 5.0.0
zip4j_version = 2.11.5
parquet_version = 1.14.4
hadoop_version = 3.4.1
Loading
Loading