Skip to content

Commit

Permalink
Added SHOW TABLES and DESCRIBE table support (apache#12293)
Browse files Browse the repository at this point in the history
  • Loading branch information
aadilkhalifa authored and rajagopr committed Jul 17, 2024
1 parent 394492f commit 6fcfd01
Show file tree
Hide file tree
Showing 6 changed files with 821 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -305,4 +305,48 @@ public static Object arrayValueConstructor(Object... arr) {
}
return arr;
}

@ScalarFunction
public static int[] generateIntArray(int start, int end, int inc) {
int size = (end - start) / inc + 1;
int[] arr = new int[size];

for (int i = 0, value = start; i < size; i++, value += inc) {
arr[i] = value;
}
return arr;
}

@ScalarFunction
public static long[] generateLongArray(long start, long end, long inc) {
int size = (int) ((end - start) / inc + 1);
long[] arr = new long[size];

for (int i = 0; i < size; i++, start += inc) {
arr[i] = start;
}
return arr;
}

@ScalarFunction
public static float[] generateFloatArray(float start, float end, float inc) {
int size = (int) ((end - start) / inc + 1);
float[] arr = new float[size];

for (int i = 0; i < size; i++, start += inc) {
arr[i] = start;
}
return arr;
}

@ScalarFunction
public static double[] generateDoubleArray(double start, double end, double inc) {
int size = (int) ((end - start) / inc + 1);
double[] arr = new double[size];

for (int i = 0; i < size; i++, start += inc) {
arr[i] = start;
}
return arr;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ public class FunctionDefinitionRegistryTest {
private static final List<String> IGNORED_FUNCTION_NAMES = ImmutableList.of(
// Geo functions are defined in pinot-core
"geotoh3",
// ArrayToMV and ArrayValueConstructor are placeholder functions without implementation
"arraytomv", "arrayvalueconstructor",
// ArrayToMV, ArrayValueConstructor and GenerateArray are placeholder functions without implementation
"arraytomv", "arrayvalueconstructor", "generatearray",
// Scalar function
"scalar",
// Functions without scalar function counterpart as of now
Expand Down
Loading

0 comments on commit 6fcfd01

Please sign in to comment.