Skip to content
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

Error generating changelog with views #115

Open
JeremyDel opened this issue Mar 19, 2024 · 3 comments
Open

Error generating changelog with views #115

JeremyDel opened this issue Mar 19, 2024 · 3 comments

Comments

@JeremyDel
Copy link

When generating a changelog that contains a new view definition I get the following error:

[2024-03-19 16:08:04] SEVERE [liquibase.integration] java.lang.NullPointerException
liquibase.exception.CommandExecutionException: java.lang.NullPointerException
at liquibase.command.CommandScope.execute(CommandScope.java:253)
at liquibase.integration.commandline.CommandRunner.call(CommandRunner.java:55)
at liquibase.integration.commandline.CommandRunner.call(CommandRunner.java:24)
at picocli.CommandLine.executeUserObject(CommandLine.java:2041)
at picocli.CommandLine.access$1500(CommandLine.java:148)
at picocli.CommandLine$RunLast.executeUserObjectOfLastSubcommandWithSameParent(CommandLine.java:2461)
at picocli.CommandLine$RunLast.handle(CommandLine.java:2453)
at picocli.CommandLine$RunLast.handle(CommandLine.java:2415)
at picocli.CommandLine$AbstractParseResultHandler.execute(CommandLine.java:2273)
at picocli.CommandLine$RunLast.execute(CommandLine.java:2417)
at picocli.CommandLine.execute(CommandLine.java:2170)
at liquibase.integration.commandline.LiquibaseCommandLine.lambda$execute$2(LiquibaseCommandLine.java:390)
at liquibase.Scope.child(Scope.java:195)
at liquibase.Scope.child(Scope.java:171)
at liquibase.integration.commandline.LiquibaseCommandLine.lambda$execute$3(LiquibaseCommandLine.java:365)
at liquibase.Scope.child(Scope.java:195)
at liquibase.Scope.child(Scope.java:171)
at liquibase.integration.commandline.LiquibaseCommandLine.execute(LiquibaseCommandLine.java:362)
at liquibase.integration.commandline.LiquibaseCommandLine.main(LiquibaseCommandLine.java:102)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
at liquibase.integration.commandline.LiquibaseLauncher.main(LiquibaseLauncher.java:116)
Caused by: java.lang.NullPointerException
at liquibase.ext.databricks.snapshot.jvm.ViewSnapshotGeneratorDatabricks.snapshotObject(ViewSnapshotGeneratorDatabricks.java:62)
at liquibase.snapshot.jvm.JdbcSnapshotGenerator.snapshot(JdbcSnapshotGenerator.java:65)
at liquibase.snapshot.SnapshotGeneratorChain.snapshot(SnapshotGeneratorChain.java:49)
at liquibase.snapshot.jvm.JdbcSnapshotGenerator.snapshot(JdbcSnapshotGenerator.java:68)
at liquibase.snapshot.SnapshotGeneratorChain.snapshot(SnapshotGeneratorChain.java:49)
at liquibase.snapshot.DatabaseSnapshot.include(DatabaseSnapshot.java:313)
at liquibase.snapshot.DatabaseSnapshot.replaceObject(DatabaseSnapshot.java:456)
at liquibase.snapshot.DatabaseSnapshot.replaceObject(DatabaseSnapshot.java:478)
at liquibase.snapshot.DatabaseSnapshot.includeNestedObjects(DatabaseSnapshot.java:369)
at liquibase.snapshot.DatabaseSnapshot.include(DatabaseSnapshot.java:332)
at liquibase.snapshot.DatabaseSnapshot.init(DatabaseSnapshot.java:106)
at liquibase.snapshot.DatabaseSnapshot.(DatabaseSnapshot.java:59)
at liquibase.snapshot.JdbcDatabaseSnapshot.(JdbcDatabaseSnapshot.java:37)
at liquibase.snapshot.SnapshotGeneratorFactory.createSnapshot(SnapshotGeneratorFactory.java:216)
at liquibase.snapshot.SnapshotGeneratorFactory.createSnapshot(SnapshotGeneratorFactory.java:189)
at liquibase.command.core.DiffCommandStep.generateDatabaseShapshot(DiffCommandStep.java:205)
at liquibase.command.core.DiffCommandStep.createReferenceSnapshot(DiffCommandStep.java:192)
at liquibase.command.core.DiffCommandStep.createDiffResult(DiffCommandStep.java:113)
at liquibase.command.core.DiffCommandStep.run(DiffCommandStep.java:89)
at liquibase.command.CommandScope.execute(CommandScope.java:217)

I have managed to replicate the error multiple times and whenever i add a view in my schema the generate-changelog/diffChangeLog/diff command fails immediatly.

I've liquibase 4.26.0 and installed liquibase-databricks-1.1.3 and the latest Databricsk JDBC jar files.

@Shahrukh-ali-lodhi
Copy link

@JeremyDel, have you been able to generate a change log without views, only for tables?

@JeremyDel
Copy link
Author

Yes it works only for tables, whenever i create a view statement on my schema i get this error.
I have tested multiple version of my JDBC driver for databricks but i still have the error.

@Shahrukh-ali-lodhi
Copy link

Shahrukh-ali-lodhi commented Mar 19, 2024

For me, it's not working even for tables. I'm using all the latest libraries and using databricks cluster not databricks warehouse.

I'm having the following syntax error which I can find from the databricks cluster log4j only and liquibase doesn't give any error apart from the success message:

org.apache.spark.sql.catalyst.parser.ParseException: 

[PARSE_SYNTAX_ERROR] Syntax error at or near 'call'.(line 1, pos 0)

== SQL ==
call current_schema
^^^

	at org.apache.spark.sql.catalyst.parser.ParseException.withCommand(parsers.scala:259)
	at org.apache.spark.sql.catalyst.parser.AbstractParser.parse(parsers.scala:98)
	at org.apache.spark.sql.execution.SparkSqlParser.parse(SparkSqlParser.scala:111)
	at org.apache.spark.sql.catalyst.parser.AbstractSqlParser.parsePlan(AbstractSqlParser.scala:87)
	at com.databricks.sql.parser.DatabricksSqlParser.$anonfun$parsePlan$1(DatabricksSqlParser.scala:77)
	at com.databricks.sql.parser.DatabricksSqlParser.parse(DatabricksSqlParser.scal

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants