-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Databricks Aggregate functions
Signed-off-by: Andreas Reichel <andreas@manticore-projects.com>
- Loading branch information
1 parent
973c253
commit a4491aa
Showing
4 changed files
with
158 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
58 changes: 30 additions & 28 deletions
58
src/main/java/ai/starlake/transpiler/schemas/SchemaProvider.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,34 +1,36 @@ | ||
package ai.starlake.transpiler.schemas | ||
import java.util.Map; | ||
|
||
|
||
|
||
package ai.starlake.transpiler.schemas; | ||
|
||
import java.util.Map; | ||
|
||
interface SchemaProvider { | ||
/** | ||
* Get all tables in the schema | ||
* @return Map of tables with schema name and table name as key and map of field name and field type as value | ||
*/ | ||
Map<String, Map<String, String>> getTables(); | ||
|
||
|
||
/** | ||
* Get all fields in the table | ||
* @param schemaName schema name | ||
* @param tableName table name | ||
* @return Map of field name and field type | ||
*/ | ||
Map<String, String> getTable(String schemaName, String tableName); | ||
|
||
/** | ||
* Get table regardless of schema name | ||
* @param tableName table name | ||
* @return Map of schema name where the table is found and map of field name and field type. Returning more than one key means | ||
* the table is found in multiple schemas and the resolution is ambiguous. | ||
* In the future, resolution may be done by jsqltranspiler based on the context. | ||
*/ | ||
Map<String, Map<String, String>> getTables(String tableName); | ||
/** | ||
* Get all tables in the schema | ||
* | ||
* @return Map of tables with schema name and table name as key and map of field name and field | ||
* type as value | ||
*/ | ||
Map<String, Map<String, String>> getTables(); | ||
|
||
|
||
/** | ||
* Get all fields in the table | ||
* | ||
* @param schemaName schema name | ||
* @param tableName table name | ||
* @return Map of field name and field type | ||
*/ | ||
Map<String, String> getTable(String schemaName, String tableName); | ||
|
||
/** | ||
* Get table regardless of schema name | ||
* | ||
* @param tableName table name | ||
* @return Map of schema name where the table is found and map of field name and field type. | ||
* Returning more than one key means the table is found in multiple schemas and the | ||
* resolution is ambiguous. In the future, resolution may be done by jsqltranspiler based | ||
* on the context. | ||
*/ | ||
Map<String, Map<String, String>> getTables(String tableName); | ||
|
||
} | ||
|
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters