Skip to content

Commit

Permalink
Merge branch 'refactor' of https://github.com/polypheny/Polypheny-DB
Browse files Browse the repository at this point in the history
…into refactor
  • Loading branch information
datomo committed Dec 5, 2023
2 parents 8554d47 + fb49c61 commit 59cc9de
Show file tree
Hide file tree
Showing 10 changed files with 12 additions and 27 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -115,9 +115,7 @@ public class PolyCatalog extends Catalog implements PolySerializable {
private final AtomicBoolean dirty = new AtomicBoolean( false );

@Getter
PropertyChangeListener changeListener = evt -> {
dirty.set( true );
};
PropertyChangeListener changeListener = evt -> dirty.set( true );


public PolyCatalog() {
Expand Down Expand Up @@ -183,9 +181,7 @@ private void addNamespaceIfNecessary( AllocationEntity entity ) {

// re-add physical namespace, we could check first, but not necessary

if ( getStoreSnapshot( entity.adapterId ).isPresent() ) {
getStoreSnapshot( entity.adapterId ).get().addNamespace( entity.namespaceId, adapter.getCurrentNamespace() );
}
getStoreSnapshot( entity.adapterId ).ifPresent( e -> e.addNamespace( entity.namespaceId, adapter.getCurrentNamespace() ) );

}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ public class MqlFunctions {


private MqlFunctions() {
// empty on purposeD
// empty on purpose
}


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,7 @@ private QueryInterfaceManager( TransactionManager transactionManager, Authentica


public QueryInterface getQueryInterface( String uniqueName ) {
uniqueName = uniqueName.toLowerCase();
return interfaceByName.get( uniqueName );
return interfaceByName.get( uniqueName.toLowerCase() );
}


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,9 +105,7 @@ protected AbstractAlgOptPlanner( AlgOptCostFactory costFactory, Context context
this.context = context;

Optional<CancelFlag> oCancelFlag = context.unwrap( CancelFlag.class );
this.cancelFlag = oCancelFlag.isPresent()
? oCancelFlag.get().atomicBoolean
: new AtomicBoolean();
this.cancelFlag = oCancelFlag.map( c -> c.atomicBoolean ).orElseGet( AtomicBoolean::new );

// Add abstract {@link AlgNode} classes. No RelNodes will ever be registered with these types, but some operands may use them.
classes.add( AlgNode.class );
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,6 @@ protected BinarySerializer<PolyDouble> createSerializer( int version, Compatibil
@Override
public void encode( BinaryOutput out, PolyDouble item ) {
out.writeUTF8Nullable( item.value == null ? null : item.value.toString() );
;
}


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public class PolyTimeStamp extends PolyTemporal {

public static final DateFormat dateFormat = new SimpleDateFormat( "yyyy-MM-dd HH:mm:ss" );

public Long milliSinceEpoch; // normalized to utz
public Long milliSinceEpoch; // normalized to UTC


public PolyTimeStamp( Long milliSinceEpoch ) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -195,11 +195,10 @@ protected Map<Long, List<AllocationColumn>> selectPlacementOld( LogicalTable tab
AllocationPlacement longestPlacement = catalog.getSnapshot().alloc().getPlacement( adapterIdWithMostPlacements, table.id ).orElseThrow();
for ( LogicalColumn column : logicalColumns ) {
Optional<AllocationColumn> optionalColumn = catalog.getSnapshot().alloc().getColumn( longestPlacement.id, column.id );
if ( optionalColumn.isPresent() ) {
placementList.add( optionalColumn.get() );
} else {
missingColumns.add( column );
}
optionalColumn.ifPresentOrElse(
placementList::add,
() -> missingColumns.add( column )
);
}

Map<Long, List<AllocationColumn>> placementToColumns = new HashMap<>();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -178,11 +178,8 @@ public Result setOpToSql( SqlSetOperator operator, AlgNode alg ) {
for ( Ord<AlgNode> input : Ord.zip( alg.getInputs() ) ) {
final Result result = visitChild( input.i, input.e );
if ( node == null ) {
if ( input.getValue().unwrap( JdbcScan.class ).isPresent() ) {
node = result.asSelect( input.getValue().unwrap( JdbcScan.class ).get().getEntity().getNodeList() );
} else {
node = result.asSelect();
}
node = input.getValue().unwrap( JdbcScan.class ).map( i -> result.asSelect( i.getEntity().getNodeList() ) )
.orElse( result.asSelect() );
} else {
if ( input.getValue().unwrap( JdbcScan.class ).isPresent() ) {
node = (SqlNode) operator.createCall( POS, node, result.asSelect( input.getValue().unwrap( JdbcScan.class ).get().getEntity().getNodeList() ) );
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,6 @@
import org.polypheny.db.tools.RuleSets;
import org.polypheny.db.type.PolyType;

;


/**
* Tests for {@link AlgToSqlConverter}.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -607,7 +607,6 @@ public static SqlLiteral symbol( Enum<?> o, ParserPos parserPos ) {


public static AlgDataType getNamedType( Identifier node, Snapshot snapshot ) {
;
LogicalTable table = snapshot.rel().getTable( node.getNames().get( 0 ), node.getNames().get( 1 ) ).orElse( null );
if ( table != null ) {
return table.getRowType();
Expand Down

0 comments on commit 59cc9de

Please sign in to comment.