Skip to content

Commit

Permalink
javafmt
Browse files Browse the repository at this point in the history
  • Loading branch information
radeusgd committed Mar 28, 2023
1 parent 92ec558 commit a268b33
Show file tree
Hide file tree
Showing 9 changed files with 25 additions and 26 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ type SQL_Type
null : SQL_Type
null = SQL_Type.Value Types.NULL "NULL"


## PRIVATE
Constructs a `SQL_Type` from a `ResultSetMetaData` object.
from_metadata metadata ix =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,13 +116,15 @@ private record RetypeInfo(Class<?> clazz, StorageType type) {}
new RetypeInfo(Long.class, Constants.INTEGER_64),
new RetypeInfo(Double.class, Constants.FLOAT_64),
new RetypeInfo(String.class, Constants.STRING),
// TODO [RW] I think BigDecimals should not be coerced to floats, we should add Decimal support to in-memory tables at some point
//new RetypeInfo(BigDecimal.class, StorageType.FLOAT_64),
// TODO [RW] I think BigDecimals should not be coerced to floats, we should add Decimal
// support to in-memory tables at some point
// new RetypeInfo(BigDecimal.class, StorageType.FLOAT_64),
new RetypeInfo(LocalDate.class, Constants.DATE),
new RetypeInfo(LocalTime.class, Constants.TIME_OF_DAY),
new RetypeInfo(ZonedDateTime.class, Constants.DATE_TIME),
new RetypeInfo(Float.class, Constants.FLOAT_64),
// Smaller integer types are upcast to 64-bit integers by default anyway. This logic does not apply only if a specific type is requested (so not in inferred builder).
// Smaller integer types are upcast to 64-bit integers by default anyway. This logic does
// not apply only if a specific type is requested (so not in inferred builder).
new RetypeInfo(Integer.class, Constants.INTEGER_64),
new RetypeInfo(Short.class, Constants.INTEGER_64),
new RetypeInfo(Byte.class, Constants.INTEGER_64));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ public abstract class TypedBuilder extends Builder {
public abstract boolean canRetypeTo(StorageType type);

/**
* Retype this builder to the given type. Can only be called if {@link #canRetypeTo(StorageType)} returns
* true for the type.
* Retype this builder to the given type. Can only be called if {@link #canRetypeTo(StorageType)}
* returns true for the type.
*
* @param type the target type
* @return a retyped builder
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,7 @@ public Double getItemBoxed(int idx) {
return isMissing.get(idx) ? null : Double.longBitsToDouble(data[idx]);
}

/**
* @inheritDoc
*/
/** @inheritDoc */
@Override
public StorageType getType() {
return Constants.FLOAT_64;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@

/** A column storing 64-bit integers. */
public final class LongStorage extends NumericStorage<Long> {
// TODO at some point we will want to add separate storage classes for byte, short and int, for more compact
// storage and more efficient handling of smaller integers; for now we will be handling this just by checking the
// bounds
// TODO [RW] at some point we will want to add separate storage classes for byte, short and int,
// for more compact storage and more efficient handling of smaller integers; for now we will be
// handling this just by checking the bounds
private final long[] data;
private final BitSet isMissing;
private final int size;
Expand Down Expand Up @@ -80,18 +80,14 @@ public Long getItemBoxed(int idx) {
return isMissing.get(idx) ? null : data[idx];
}

/**
* @inheritDoc
*/
/** @inheritDoc */
@Override
public StorageType getType() {
// TODO add possibility to set integer bit limit
return Constants.INTEGER_64;
}

/**
* @inheritDoc
*/
/** @inheritDoc */
@Override
public boolean isNa(long idx) {
return isMissing.get((int) idx);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@

public class MixedStorageFacade extends Storage<Object> {
private final Storage<?> underlyingStorage;

public MixedStorageFacade(Storage<?> storage) {
underlyingStorage = storage;
}
Expand Down Expand Up @@ -47,12 +48,14 @@ public boolean isOpVectorized(String name) {
}

@Override
protected Storage<?> runVectorizedMap(String name, Object argument, MapOperationProblemBuilder problemBuilder) {
protected Storage<?> runVectorizedMap(
String name, Object argument, MapOperationProblemBuilder problemBuilder) {
return underlyingStorage.runVectorizedMap(name, argument, problemBuilder);
}

@Override
protected Storage<?> runVectorizedZip(String name, Storage<?> argument, MapOperationProblemBuilder problemBuilder) {
protected Storage<?> runVectorizedZip(
String name, Storage<?> argument, MapOperationProblemBuilder problemBuilder) {
return underlyingStorage.runVectorizedZip(name, argument, problemBuilder);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public abstract class Storage<T> {
/** @return the number of NA elements in this column */
public abstract int countMissing();

/** @return the type tag of this column's storage.*/
/** @return the type tag of this column's storage. */
public abstract StorageType getType();

/**
Expand Down Expand Up @@ -245,8 +245,8 @@ protected final Storage<?> fillMissingHelper(Value arg, Builder builder) {
* counts[i]}.
*
* @param counts the mask specifying elements duplication
* @param total the sum of all elements in the mask, also interpreted as the length of the resulting
* storage
* @param total the sum of all elements in the mask, also interpreted as the length of the
* resulting storage
* @return the storage masked according to the specified rules
*/
public abstract Storage<T> countMask(int[] counts, int total);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,8 @@ public abstract class Index {
* consecutive copies of the i-th element of the original index should be {@code counts[i]}.
*
* @param counts the mask specifying elements duplication
* @param total the sum of all elements in the mask, also interpreted as the length of the resulting
* index
* @param total the sum of all elements in the mask, also interpreted as the length of the
* resulting index
* @return the index masked according to the specified rules
*/
public abstract Index countMask(int[] counts, int total);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@

public class IndexJoin implements JoinStrategy {
private record HashEqualityCondition(
Column left, Column right, TextFoldingStrategy textFoldingStrategy) {}
Column left, Column right, TextFoldingStrategy textFoldingStrategy) {
}

@Override
public JoinResult join(Table left, Table right, List<JoinCondition> conditions) {
Expand Down

0 comments on commit a268b33

Please sign in to comment.