Skip to content

Commit

Permalink
Minor Improvements and Adjustments (#512)
Browse files Browse the repository at this point in the history
  • Loading branch information
vogti committed Aug 21, 2024
1 parent 0c29181 commit ce226fd
Show file tree
Hide file tree
Showing 197 changed files with 243 additions and 287 deletions.
4 changes: 2 additions & 2 deletions NOTICE
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Polypheny-DB
Copyright 2017-2022 The Polypheny Project
Copyright 2017-2024 The Polypheny Project

This product includes software developed at
The Apache Software Foundation (http://www.apache.org/).
Expand All @@ -11,4 +11,4 @@ under the auspices of the Eigenbase Foundation
and released as the LucidDB project.

Polypheny-DB is a research system that emerged from the
University of Basel, Switzerland.
University of Basel, Switzerland.
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,13 @@ Please note that we have a [code of conduct](https://github.com/polypheny/Admin/
## Credits ##
_Polypheny-DB_ builds upon the great work of several other projects:

* [Apache Avatica](https://calcite.apache.org/avatica/): A framework for building database drivers
* [Apache Calcite](https://calcite.apache.org/): A framework for building databases
* [HSQLDB](http://hsqldb.org/): A relational database written in Java
* [JavaCC](https://javacc.org/): A parser generator
* [Javalin](https://javalin.io/): A framework for building web services
* [Project Lombok](https://projectlombok.org/): A library which provides annotations for tedious tasks

Except for the first two, those projects are used "as is" and integrated as a library. _Apache Avatica_ we [forked](https://github.com/polypheny/Avatica) and made some Polypheny-DB specific adjustments. From _Apache Calcite_ we use parts of the code as foundation for Polypheny-DB.
Except for _Apache Calcite, those projects are used "as is" and are integrated as libraries. From _Apache Calcite_ we used parts of the code as foundation for Polypheny-DB.

## Acknowledgements
The Polypheny-DB project is supported by the Swiss National Science Foundation (SNSF) under the contract no. 200021_172763.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,5 @@ protected ConfigScalar( final String key ) {
protected ConfigScalar( final String key, final String description ) {
super( key, description );
}
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,5 @@ public class ConfigRuntimeException extends RuntimeException {
public ConfigRuntimeException( String msg ) {
super( msg );
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ public enum ConnectionMethod {
LINK,
UPLOAD;


public static ConnectionMethod from( String name ) {
return ConnectionMethod.valueOf( name.toUpperCase() );
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ public AlgNode getGraphModify( long allocId, LpgModify<?> modify, AlgBuilder bui
return Modifiable.getGraphModifySubstitute( modifiable, allocId, modify, builder );
}


@Override
public void addColumn( Context context, long allocId, LogicalColumn column ) {
modifiable.addColumn( context, allocId, column );
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,5 +126,4 @@ public void dropCollection( Context context, AllocationCollection allocation ) {
}



}
2 changes: 1 addition & 1 deletion core/src/main/java/org/polypheny/db/adapter/Scannable.java
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ static void dropCollectionSubstitute( Scannable scannable, Context context, Allo
void renameLogicalColumn( long id, String newColumnName );


record ColumnContext(String name, Integer precision, PolyType type, boolean nullable) {
record ColumnContext( String name, Integer precision, PolyType type, boolean nullable ) {

}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,5 +62,5 @@
* Maximum number of elements in the array. -1 means no maximum.
*/
long maximumCardinality() default -1L;
}

}
2 changes: 1 addition & 1 deletion core/src/main/java/org/polypheny/db/adapter/java/Map.java
Original file line number Diff line number Diff line change
Expand Up @@ -67,5 +67,5 @@
* Whether values may be null.
*/
boolean valueIsNullable() default true;
}

}
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@

/**
* Query provider based on Java in-memory data structures.
*/

package org.polypheny.db.adapter.java;

2 changes: 0 additions & 2 deletions core/src/main/java/org/polypheny/db/adapter/package-info.java
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@

/**
* Polypheny-DB adapters.
*/

package org.polypheny.db.adapter;

Original file line number Diff line number Diff line change
Expand Up @@ -945,7 +945,6 @@ public interface SelfFlatteningAlg extends AlgNode {
private class RewriteAlgVisitor extends AlgVisitor {



@Override
public void visit( AlgNode p, int ordinal, AlgNode parent ) {
// Rewrite children first
Expand Down Expand Up @@ -1097,4 +1096,3 @@ private RexNode flattenComparison( RexBuilder rexBuilder, Operator op, List<RexN
}

}

Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

/**
* Defines relational expressions and rules for converting between calling conventions.
*/
Expand Down
1 change: 0 additions & 1 deletion core/src/main/java/org/polypheny/db/algebra/core/Calc.java
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,6 @@ public boolean isValid( Litmus litmus, Context context ) {
}



@Override
public double estimateTupleCount( AlgMetadataQuery mq ) {
return AlgMdUtil.estimateFilteredRows( getInput(), program, mq );
Expand Down
2 changes: 0 additions & 2 deletions core/src/main/java/org/polypheny/db/algebra/core/Match.java
Original file line number Diff line number Diff line change
Expand Up @@ -330,7 +330,6 @@ public Object visitCall( RexCall call ) {
}



public Set<String> go( List<RexNode> rexNodeList ) {
for ( RexNode rex : rexNodeList ) {
rex.accept( this );
Expand Down Expand Up @@ -364,4 +363,3 @@ public int compareTo( RexMRAggCall o ) {
}

}

Original file line number Diff line number Diff line change
Expand Up @@ -54,5 +54,5 @@ public interface AggAddContext extends AggResultContext {
* @return {@link RexToLixTranslator} suitable to transform the arguments
*/
RexToLixTranslator rowTranslator();
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -79,4 +79,5 @@ public interface AggImplementor {
* @return Expression that is a result of calculating final value of the aggregate being implemented
*/
Expression implementResult( AggContext info, AggResultContext result );

}
Original file line number Diff line number Diff line change
Expand Up @@ -35,5 +35,5 @@ public interface AggResetContext extends NestedBlockBuilder {
* @see AggImplementor#getStateType(AggContext)
*/
List<Expression> accumulator();
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -43,4 +43,5 @@ public interface AggregateLambdaFactory<TSource, TOrigAccumulate, TAccumulate, T
Function1<TAccumulate, TResult> singleGroupResultSelector( Function1<TOrigAccumulate, TResult> resultSelector );

Function2<TKey, TAccumulate, TResult> resultSelector( Function2<TKey, TOrigAccumulate, TResult> resultSelector );

}
Original file line number Diff line number Diff line change
Expand Up @@ -40,5 +40,5 @@ public interface CallImplementor {
* @return Translated call
*/
Expression implement( RexToLixTranslator translator, RexCall call, RexImpTable.NullAs nullAs );
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -113,9 +113,8 @@ public Prefer of( JavaTupleFormat format ) {
*
* @param physType Describes the Java type returned by this relational expression, and the mapping between it and the fields of the logical row type.
*/
record Result(BlockStatement block, PhysType physType, JavaTupleFormat format) {
record Result( BlockStatement block, PhysType physType, JavaTupleFormat format ) {

}

}

Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ public AlgOptCost computeSelfCost( AlgPlanner planner, AlgMetadataQuery mq ) {
/**
* Implementation of {@link RexToLixTranslator.InputGetter} suitable for generating implementations of windowed aggregate functions.
*/
private record WindowRelInputGetter(Expression row, PhysType rowPhysType, int actualInputFieldCount, List<Expression> constants) implements RexToLixTranslator.InputGetter {
private record WindowRelInputGetter( Expression row, PhysType rowPhysType, int actualInputFieldCount, List<Expression> constants ) implements RexToLixTranslator.InputGetter {


@Override
Expand Down Expand Up @@ -843,4 +843,3 @@ private Expression translateBound(
}

}

Original file line number Diff line number Diff line change
Expand Up @@ -90,5 +90,5 @@ public interface NestedBlockBuilder {
* @see #nestBlock()
*/
void exitBlock();
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -146,5 +146,5 @@ public final void exitBlock() {
blocks.remove( blocks.size() - 1 );
nullables.remove( nullables.size() - 1 );
}
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ private void add( TSource source ) {
public @NotNull Iterator<TSource> iterator() {
return list.iterator();
}

}

}

Original file line number Diff line number Diff line change
Expand Up @@ -105,5 +105,7 @@ public TAccumulate apply( TAccumulate accumulator, TSource source ) {
}
return result;
}

}

}
Original file line number Diff line number Diff line change
Expand Up @@ -71,5 +71,5 @@ public void sortAndAccumulate( Iterable<TSource> sourceIterable, TAccumulate acc
accumulator1 = accumulatorAdder.apply( accumulator1, source );
}
}
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -105,5 +105,5 @@ protected final Expression implementNotNullResult( AggContext info, AggResultCon
public boolean needCacheWhenFrameIntact() {
return true;
}
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -55,5 +55,5 @@ public interface WinAggAddContext extends AggAddContext, WinAggResultContext {
* @see WinAggFrameContext#startIndex()
*/
Expression currentPosition();
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -86,5 +86,5 @@ public interface WinAggFrameContext {
* @return number of rows in the current partition or 0 if the partition is empty
*/
Expression getPartitionRowCount();
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -83,5 +83,5 @@ public interface WinAggFrameResultContext extends WinAggFrameContext {
* @return result of comparison as as in {@link Comparable#compareTo}
*/
Expression compareRows( Expression a, Expression b );
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -78,5 +78,5 @@ enum SeekType {
}

boolean needCacheWhenFrameIntact();
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -60,5 +60,5 @@ public interface WinAggResultContext extends AggResultContext, WinAggFrameResult
* @return Linq4j form of arguments of the particular row
*/
List<Expression> arguments( Expression rowIndex );
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -48,4 +48,5 @@ public final RexToLixTranslator rowTranslator() {
public final List<Expression> arguments() {
return rowTranslator().translateList( rexArguments() );
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -101,5 +101,5 @@ public Expression getFrameRowCount() {
public Expression getPartitionRowCount() {
return partitionRowCount;
}
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -122,5 +122,5 @@ public Expression getFrameRowCount() {
public Expression getPartitionRowCount() {
return getFrame().getPartitionRowCount();
}
}

}
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@

/**
* Facilities to externalize {@link org.polypheny.db.algebra.AlgNode}s to and from XML and JSON format.
*/

package org.polypheny.db.algebra.externalize;

Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ interface TrimFlagHolder {

@Nullable
Flag getFlag();

}

}
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ public class LogicalStreamer extends Streamer {

/**
* {@code
* Streamer
* Streamer
* ^ |
* | v
* Provider Collector
Expand Down Expand Up @@ -184,7 +184,6 @@ public static void attachFilter( AlgNode modify, AlgBuilder algBuilder, RexBuild
}
}


attachFilter( modify.getEntity(), algBuilder, rexBuilder, indexes );
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,6 @@ private static LogicalDocumentAggregate create_( final AlgNode input, @Nullable
}




@Override
public AlgNode copy( AlgTraitSet traitSet, List<AlgNode> inputs ) {
return new LogicalDocumentAggregate( inputs.get( 0 ).getCluster(), traitSet, inputs.get( 0 ), getGroup().orElse( null ), aggCalls );
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

/**
* Defines logical relational expressions.
*
Expand All @@ -10,4 +9,3 @@
*/

package org.polypheny.db.algebra.logical;

Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ public static AlgMetadataProvider of( List<AlgMetadataProvider> list ) {
/**
* Invocation handler that calls a list of {@link Metadata} objects, returning the first non-null value.
*/
private record ChainedInvocationHandler(List<Metadata> metadataList) implements InvocationHandler {
private record ChainedInvocationHandler( List<Metadata> metadataList ) implements InvocationHandler {

private ChainedInvocationHandler( List<Metadata> metadataList ) {
this.metadataList = ImmutableList.copyOf( metadataList );
Expand Down Expand Up @@ -162,4 +162,3 @@ public Object invoke( Object proxy, Method method, Object[] args ) throws Throwa
}

}

Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@

/**
* Defines metadata interfaces and utilities for relational expressions.
*/

package org.polypheny.db.algebra.metadata;

Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

/**
* Defines mutable relational expressions.
*
Expand Down
2 changes: 0 additions & 2 deletions core/src/main/java/org/polypheny/db/algebra/package-info.java
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

/**
* Defines relational expressions.
*
Expand All @@ -11,4 +10,3 @@
*/

package org.polypheny.db.algebra;

Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@
* to a {@link BindableScan}.
*
* The {@link #INTERPRETER} variant allows an intervening {@link EnumerableInterpreter}.
*
*/
public abstract class FilterScanRule extends AlgOptRule {

Expand Down
Loading

0 comments on commit ce226fd

Please sign in to comment.