Skip to content

Commit

Permalink
Revert getPrimitive renames.
Browse files Browse the repository at this point in the history
  • Loading branch information
jdunkerley committed Jan 26, 2025
1 parent 1af40f2 commit 27bcd77
Show file tree
Hide file tree
Showing 38 changed files with 99 additions and 105 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -85,15 +85,15 @@ void accumulate(
if (storage instanceof ColumnDoubleStorage doubleStorage) {
for (int i : indexes) {
if (!doubleStorage.isNothing(i)) {
total += doubleStorage.getPrimitive(i);
total += doubleStorage.getItemDouble(i);
count++;
}
context.safepoint();
}
} else if (storage instanceof ColumnLongStorage longStorage) {
for (int i : indexes) {
if (!longStorage.isNothing(i)) {
total += longStorage.getPrimitive(i);
total += longStorage.getItemLong(i);
count++;
}
context.safepoint();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ void accumulate(List<Integer> indexes, Storage<?> storage) {
if (storage instanceof ColumnLongStorage longStorage) {
for (int row : indexes) {
if (!longStorage.isNothing(row)) {
addLong(longStorage.getPrimitive(row));
addLong(longStorage.getItemLong(row));
}
context.safepoint();
}
Expand Down Expand Up @@ -171,7 +171,7 @@ void accumulate(List<Integer> indexes, Storage<?> storage) {
if (storage instanceof ColumnDoubleStorage doubleStorage) {
for (int row : indexes) {
if (!doubleStorage.isNothing(row)) {
addDouble(doubleStorage.getPrimitive(row));
addDouble(doubleStorage.getItemDouble(row));
}
context.safepoint();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ public void appendBulkStorage(Storage<?> storage) {
if (storage.isNothing(i)) {
appendNulls(1);
} else {
long item = longStorage.getPrimitive(i);
long item = longStorage.getItemLong(i);
append(BigInteger.valueOf(item));
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ public void appendBulkStorage(Storage<?> storage) {
if (columnBooleanStorage.isNothing(i)) {
appendNulls(1);
} else {
appendBoolean(columnBooleanStorage.getPrimitive(i));
appendBoolean(columnBooleanStorage.getItemBoolean(i));
}
}
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ public void appendBulkStorage(Storage<?> storage) {
if (storage.isNothing(i)) {
appendNulls(1);
} else {
appendDouble(doubleStorage.getPrimitive(i));
appendDouble(doubleStorage.getItemDouble(i));
}
}
} else {
Expand All @@ -114,7 +114,7 @@ public void appendBulkStorage(Storage<?> storage) {
if (storage.isNothing(i)) {
appendNulls(1);
} else {
long item = longStorage.getPrimitive(i);
long item = longStorage.getItemLong(i);
appendDouble(convertLongToDouble(item));
}
}
Expand Down Expand Up @@ -148,7 +148,7 @@ public void appendBulkStorage(Storage<?> storage) {
if (boolStorage.isNothing(i)) {
appendNulls(1);
} else {
appendDouble(boolStorage.getPrimitive(i) ? 1.0 : 0.0);
appendDouble(boolStorage.getItemBoolean(i) ? 1.0 : 0.0);
}
}
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ public void appendBulkStorage(Storage<?> storage) {
if (longStorage.isNothing(i)) {
appendNulls(1);
} else {
appendLong(longStorage.getPrimitive(i));
appendLong(longStorage.getItemLong(i));
}
}
} else {
Expand All @@ -118,7 +118,7 @@ public void appendBulkStorage(Storage<?> storage) {
if (boolStorage.isNothing(i)) {
appendNulls(1);
} else {
appendLong(boolStorage.getPrimitive(i) ? 1L : 0L);
appendLong(boolStorage.getItemBoolean(i) ? 1L : 0L);
}
}
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ static void applyOverBooleanStorage(
booleanStorage,
nothingUnchanged,
builder,
i -> function.accept(booleanStorage.isNothing(i), booleanStorage.getPrimitive(i)));
i -> function.accept(booleanStorage.isNothing(i), booleanStorage.getItemBoolean(i)));
}

@FunctionalInterface
Expand All @@ -147,7 +147,7 @@ static void applyOverLongStorage(
longStorage,
nothingUnchanged,
builder,
i -> function.accept(longStorage.isNothing(i), longStorage.getPrimitive(i)));
i -> function.accept(longStorage.isNothing(i), longStorage.getItemLong(i)));
}

@FunctionalInterface
Expand All @@ -165,7 +165,7 @@ static void applyOverDoubleStorage(
doubleStorage,
nothingUnchanged,
builder,
i -> function.accept(doubleStorage.isNothing(i), doubleStorage.getPrimitive(i)));
i -> function.accept(doubleStorage.isNothing(i), doubleStorage.getItemDouble(i)));
}

@FunctionalInterface
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ private Storage<BigDecimal> convertDoubleStorage(
Builder.getForBigDecimal(doubleStorage.getSize()),
doubleStorage,
(i) -> {
double x = doubleStorage.getPrimitive(i);
double x = doubleStorage.getItemDouble(i);
return BigDecimal.valueOf(x);
});
}
Expand All @@ -54,7 +54,7 @@ private Storage<BigDecimal> convertLongStorage(
Builder.getForBigDecimal(longStorage.getSize()),
longStorage,
(i) -> {
long x = longStorage.getPrimitive(i);
long x = longStorage.getItemLong(i);
return BigDecimal.valueOf(x);
});
}
Expand All @@ -65,7 +65,7 @@ private Storage<BigDecimal> convertBoolStorage(
Builder.getForBigDecimal(boolStorage.getSize()),
boolStorage,
(i) -> {
boolean x = boolStorage.getPrimitive(i);
boolean x = boolStorage.getItemBoolean(i);
return booleanAsBigDecimal(x);
});
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ private Storage<BigInteger> convertDoubleStorage(
Builder.getForBigInteger(doubleStorage.getSize(), problemAggregator),
doubleStorage,
(i) -> {
double x = doubleStorage.getPrimitive(i);
double x = doubleStorage.getItemDouble(i);
return BigDecimal.valueOf(x).toBigInteger();
});
}
Expand All @@ -54,7 +54,7 @@ private Storage<BigInteger> convertLongStorage(
Builder.getForBigInteger(longStorage.getSize(), problemAggregator),
longStorage,
(i) -> {
long x = longStorage.getPrimitive(i);
long x = longStorage.getItemLong(i);
return BigInteger.valueOf(x);
});
}
Expand All @@ -65,7 +65,7 @@ private Storage<BigInteger> convertBoolStorage(
Builder.getForBigInteger(boolStorage.getSize(), problemAggregator),
boolStorage,
(i) -> {
boolean x = boolStorage.getPrimitive((int) i);
boolean x = boolStorage.getItemBoolean((int) i);
return booleanAsBigInteger(x);
});
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ private Storage<Double> convertLongStorage(
Builder.getForDouble(FloatType.FLOAT_64, longStorage.getSize(), problemAggregator),
longStorage,
(builder, i) -> {
long value = longStorage.getPrimitive(i);
long value = longStorage.getItemLong(i);
builder.appendLong(value);
});
}
Expand All @@ -114,7 +114,7 @@ private Storage<Double> convertBoolStorage(
Builder.getForDouble(FloatType.FLOAT_64, boolStorage.getSize(), problemAggregator),
boolStorage,
(builder, i) -> {
boolean value = boolStorage.getPrimitive(i);
boolean value = boolStorage.getItemBoolean(i);
builder.appendDouble(booleanAsDouble(value));
});
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ private Storage<Long> convertBoolStorage(
Builder.getForLong(targetType, boolStorage.getSize(), problemAggregator),
boolStorage,
(builder, i) -> {
boolean value = boolStorage.getPrimitive(i);
boolean value = boolStorage.getItemBoolean(i);
builder.appendLong(booleanAsLong(value));
});
}
Expand All @@ -131,7 +131,7 @@ private Storage<Long> convertDoubleStorage(
Builder.getForLong(targetType, doubleStorage.getSize(), problemAggregator),
doubleStorage,
(builder, i) -> {
double value = doubleStorage.getPrimitive(i);
double value = doubleStorage.getItemDouble(i);
if (targetType.fits(value)) {
long converted = (long) value;
builder.appendLong(converted);
Expand All @@ -155,7 +155,7 @@ private Storage<Long> convertLongStorage(
Builder.getForLong(targetType, longStorage.getSize(), problemAggregator),
longStorage,
(builder, i) -> {
long value = longStorage.getPrimitive(i);
long value = longStorage.getItemLong(i);
builder.appendLong(value);
});
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ private Storage<String> castLongStorage(
Builder.getForText(longStorage.getSize(), targetType),
longStorage,
(i) -> {
long value = longStorage.getPrimitive(i);
long value = longStorage.getItemLong(i);
return adapt(Long.toString(value), problemAggregator);
});
}
Expand All @@ -88,7 +88,7 @@ private Storage<String> castBoolStorage(
Builder.getForText(boolStorage.getSize(), targetType),
boolStorage,
(i) -> {
boolean value = boolStorage.getPrimitive(i);
boolean value = boolStorage.getItemBoolean(i);
return adapt(convertBoolean(value), problemAggregator);
});
}
Expand All @@ -99,7 +99,7 @@ private Storage<String> castDoubleStorage(
Builder.getForText(doubleStorage.getSize(), targetType),
doubleStorage,
(i) -> {
double value = doubleStorage.getPrimitive(i);
double value = doubleStorage.getItemDouble(i);
return adapt(Double.toString(value), problemAggregator);
});
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public Storage<?> runTernaryMap(

for (long i = 0; i < storage.getSize(); i++) {
if (!storage.isNothing(i)) {
double item = storage.getPrimitive(i);
double item = storage.getItemDouble(i);
boolean special = Double.isNaN(item) || Double.isInfinite(item);
if (!special) {
longBuilder.appendLong(
Expand All @@ -66,7 +66,7 @@ public Storage<?> runTernaryMap(

for (long i = 0; i < storage.getSize(); i++) {
if (!storage.isNothing(i)) {
double item = storage.getPrimitive(i);
double item = storage.getItemDouble(i);
boolean special = Double.isNaN(item) || Double.isInfinite(item);
if (!special) {
doubleBuilder.appendDouble(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public Storage<Long> runTernaryMap(
var builder = Builder.getForLong(IntegerType.INT_64, storage.getSize(), problemAggregator);
for (long i = 0; i < storage.getSize(); i++) {
if (!storage.isNothing(i)) {
long item = storage.getPrimitive(i);
long item = storage.getItemLong(i);
boolean outOfRange = item < ROUND_MIN_LONG || item > ROUND_MAX_LONG;
if (!outOfRange) {
builder.appendLong(Core_Math_Utils.roundLong(item, decimalPlaces, useBankers));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,11 +93,11 @@ protected Storage<Long> runLongZip(
builder.appendNulls(1);
} else {
if (aNothing) {
builder.appendLong(b.getPrimitive(i));
builder.appendLong(b.getItemLong(i));
} else if (bNothing) {
builder.appendLong(a.getPrimitive(i));
builder.appendLong(a.getItemLong(i));
} else {
Long r = doLong(a.getPrimitive(i), b.getPrimitive(i), i, problemAggregator);
Long r = doLong(a.getItemLong(i), b.getItemLong(i), i, problemAggregator);
if (r == null) {
builder.appendNulls(1);
} else {
Expand Down Expand Up @@ -126,7 +126,7 @@ protected Storage<Long> runLongMap(
if (a.isNothing(i)) {
builder.appendLong(bNonNull);
} else {
Long r = doLong(a.getPrimitive(i), bNonNull, i, problemAggregator);
Long r = doLong(a.getItemLong(i), bNonNull, i, problemAggregator);
if (r == null) {
builder.appendNulls(1);
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ protected Storage<Long> runLongZip(
if (a.isNothing(i) || (i >= m || b.isNothing(i))) {
builder.appendNulls(1);
} else {
Long r = doLong(a.getPrimitive(i), b.getPrimitive(i), i, problemAggregator);
Long r = doLong(a.getItemLong(i), b.getItemLong(i), i, problemAggregator);
if (r == null) {
builder.appendNulls(1);
} else {
Expand Down Expand Up @@ -256,7 +256,7 @@ protected Storage<Long> runLongMap(
if (a.isNothing(i)) {
builder.appendNulls(1);
} else {
Long r = doLong(a.getPrimitive(i), bNonNull, i, problemAggregator);
Long r = doLong(a.getItemLong(i), bNonNull, i, problemAggregator);
if (r == null) {
builder.appendNulls(1);
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ protected Storage<Boolean> runLongMap(
if (lhs.isNothing(i)) {
builder.appendNulls(1);
} else {
long item = lhs.getPrimitive(i);
long item = lhs.getItemLong(i);
boolean r = doLong(item, rhs);
builder.appendBoolean(r);
}
Expand Down Expand Up @@ -279,8 +279,8 @@ protected Storage<Boolean> runLongZip(
if (lhs.isNothing(i) || (i >= m || rhs.isNothing(i))) {
builder.appendNulls(1);
} else {
long x = lhs.getPrimitive(i);
long y = rhs.getPrimitive(i);
long x = lhs.getItemLong(i);
long y = rhs.getItemLong(i);
boolean r = doLong(x, y);
builder.appendBoolean(r);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ public BigDecimal getItem(long i) {
if (storage.isNothing(i)) {
return null;
} else {
long x = storage.getPrimitive(i);
long x = storage.getItemLong(i);
return BigDecimal.valueOf(x);
}
}
Expand All @@ -131,7 +131,7 @@ public BigDecimal getItem(long i) {
if (storage.isNothing(i)) {
return null;
} else {
double x = storage.getPrimitive(i);
double x = storage.getItemDouble(i);
return BigDecimal.valueOf(x);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ public BigInteger getItem(int i) {
if (storage.isNothing(i)) {
return null;
} else {
long x = storage.getPrimitive(i);
long x = storage.getItemLong(i);
return BigInteger.valueOf(x);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ private LongStorageAsDouble(AbstractLongStorage storage) {

@Override
public double getItemAsDouble(int i) {
long x = storage.getPrimitive(i);
long x = storage.getItemLong(i);
return (double) x;
}

Expand Down
Loading

0 comments on commit 27bcd77

Please sign in to comment.