-
Notifications
You must be signed in to change notification settings - Fork 106
Add default scala template #119
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add default scala template #119
Conversation
.../templates/default-scala/template/{{.project_name}}/resources/{{.project_name}}.job.yml.tmpl
Outdated
Show resolved
Hide resolved
contrib/templates/default-scala/databricks_template_schema.json
Outdated
Show resolved
Hide resolved
We will beta preview first with some slight changes to the existing template until we can get the big pr approved (#119).
| import org.apache.spark.sql.functions.udf | ||
|
|
||
| object Main { | ||
| def main(args: Array[String]): Unit = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This would use the same catalog/schema parameters as seen in the default template:
At this point all the default templates offer a parametrizable catalog and schema.
This could also be done in a follow-up.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
updated
contrib/templates/default-scala/template/{{.project_name}}/README.md.tmpl
Outdated
Show resolved
Hide resolved
contrib/templates/default-scala/databricks_template_schema.json
Outdated
Show resolved
Hide resolved
contrib/templates/default-scala/databricks_template_schema.json
Outdated
Show resolved
Hide resolved
405428d to
57b3e64
Compare
57b3e64 to
ca5a72b
Compare
contrib/templates/default-scala/databricks_template_schema.json
Outdated
Show resolved
Hide resolved
lennartkats-db
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please review open comments
contrib/templates/default-scala/databricks_template_schema.json
Outdated
Show resolved
Hide resolved
...ib/templates/default-scala/template/{{.project_name}}/src/main/scala/com/examples/Main.scala
Show resolved
Hide resolved
| def main(args: Array[String]): Unit = { | ||
| println("Hello, World!") | ||
|
|
||
| val catalog = getFromArgs(args, "catalog").getOrElse("samples") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove default samples return..
| println("Hello, World!") | ||
|
|
||
| val catalog = getFromArgs(args, "catalog").getOrElse("samples") | ||
| val schema = getFromArgs(args, "schema").getOrElse("nyctaxi") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
spark.sql(s"USE SCHEMA $schema")
...ib/templates/default-scala/template/{{.project_name}}/src/main/scala/com/examples/Main.scala
Outdated
Show resolved
Hide resolved
contrib/templates/default-scala/template/{{.project_name}}/databricks.yml.tmpl
Outdated
Show resolved
Hide resolved
contrib/templates/default-scala/databricks_template_schema.json
Outdated
Show resolved
Hide resolved
88cdc26 to
5c664e6
Compare
## Changes <!-- Brief summary of your changes that is easy to understand --> This adds a new default scala DABs template as a follow up to databricks/bundle-examples#119 ## Why <!-- Why are these changes needed? Provide the context that the reviewer might be missing. For example, were there any decisions behind the change that are not reflected in the code itself? --> This is to provide an off the shelf template for customers to start using scala dbconnect to develop scala jobs in Databricks ## Tests <!-- How have you tested the changes? --> Manually tested user flow interactively and as job workload for both standard and serverless <!-- If your PR needs to be included in the release notes for next release, add a separate entry in NEXT_CHANGELOG.md as part of your PR. -->
## Changes <!-- Brief summary of your changes that is easy to understand --> This adds a new default scala DABs template as a follow up to databricks/bundle-examples#119 ## Why <!-- Why are these changes needed? Provide the context that the reviewer might be missing. For example, were there any decisions behind the change that are not reflected in the code itself? --> This is to provide an off the shelf template for customers to start using scala dbconnect to develop scala jobs in Databricks ## Tests <!-- How have you tested the changes? --> Manually tested user flow interactively and as job workload for both standard and serverless <!-- If your PR needs to be included in the release notes for next release, add a separate entry in NEXT_CHANGELOG.md as part of your PR. -->
Make the scala-job a default scala template. The following changes were made: