SQL parse error when using "WITH CHANGE DATA FEED" on Databricks - sql

This works:
ALTER SHARE my_share ADD TABLE main.default.my_table;
This doesn't:
ALTER SHARE my_share ADD TABLE main.default.my_table WITH CHANGE DATA FEED;
But according to the docs it should. But I get a "ParseException" and no further details.
What's the right syntax?
The cluster is running Databricks Runtime 10.4 LTS.

This is fixed in Databricks Runtime 11.3 LTS.

Related

How to solve the ENGINE = InnoDB' error in SQL? [duplicate]

Im using xampp control panel and from there i start the process for apache and mysql. Then i go to mysql workbench and server status seems to be ok, here is some info
Host: Windows-PC
Socket: C:/xampp/mysql/mysql.sock
Port: 3306
Version 10.1.31-MariaDB mariadb.org binary distribution
Compiled For: Win32(32)
Configuratin File: unknown
Then everytime when i try to add the foreign key for my dummy schema like:
ALTER TABLE `puppies`.`animals`
ADD INDEX `Breed_idx` (`BreedID` ASC) VISIBLE;
;
ALTER TABLE `puppies`.`animals`
ADD CONSTRAINT `Breed`
FOREIGN KEY (`BreedID`)
REFERENCES `puppies`.`breeds` (`Breed`)
ON DELETE NO ACTION
ON UPDATE NO ACTION;
I get the following error
ERROR 1064: You have an error in your SQL syntax; check the manual that
corresponds to your MariaDB server version for the right syntax to use near
'' at line 2
SQL Statement:
ALTER TABLE `puppies`.`animals`
ADD INDEX `Breed_idx` (`BreedID` ASC) VISIBLE
So what can i do so that xampp will start using mysql syntax over mariaDb?
Or if im wrong in my understanding of the problem, then what should i do so that i dont have to face this kind of issues again when using xampp?
Problem is the word VISIBLE, remove it and it will work.
Index are visible by default.
Your question: "If i remove VISIBLE it works just fine, so why did mysql workbench decided to add visible?"
My answer: The option to mark index invisible is not yet implemented in MariaDB (afaik!).
Update:
The syntax for MariaDB is different, please see this reference: https://jira.mariadb.org/browse/MDEV-7317
Just to add to those who are using Maria DB with MySQL Workbench, you don't need to install mysql. You can just change 'Default Target MySQL Version' from Preferences to 5.7 or 5.6, and the VISIBLE keyword will be removed by workbench.
Here is a link from mysql bugs
https://bugs.mysql.com/bug.php?id=92269
I am using MySQL Workbench and have same problem. Change in the Preferences but it did not work.
Solution: If you export forward-engineer the model you need to change the configuration on another place.
Go to Model > Model Options
Inside the Model Options, go to MySQL
Then change the "Target MySQL Version" to 5.6

MySQL Error 1064: You have an error in your SQL syntax workbench 8.0 [duplicate]

Im using xampp control panel and from there i start the process for apache and mysql. Then i go to mysql workbench and server status seems to be ok, here is some info
Host: Windows-PC
Socket: C:/xampp/mysql/mysql.sock
Port: 3306
Version 10.1.31-MariaDB mariadb.org binary distribution
Compiled For: Win32(32)
Configuratin File: unknown
Then everytime when i try to add the foreign key for my dummy schema like:
ALTER TABLE `puppies`.`animals`
ADD INDEX `Breed_idx` (`BreedID` ASC) VISIBLE;
;
ALTER TABLE `puppies`.`animals`
ADD CONSTRAINT `Breed`
FOREIGN KEY (`BreedID`)
REFERENCES `puppies`.`breeds` (`Breed`)
ON DELETE NO ACTION
ON UPDATE NO ACTION;
I get the following error
ERROR 1064: You have an error in your SQL syntax; check the manual that
corresponds to your MariaDB server version for the right syntax to use near
'' at line 2
SQL Statement:
ALTER TABLE `puppies`.`animals`
ADD INDEX `Breed_idx` (`BreedID` ASC) VISIBLE
So what can i do so that xampp will start using mysql syntax over mariaDb?
Or if im wrong in my understanding of the problem, then what should i do so that i dont have to face this kind of issues again when using xampp?
Problem is the word VISIBLE, remove it and it will work.
Index are visible by default.
Your question: "If i remove VISIBLE it works just fine, so why did mysql workbench decided to add visible?"
My answer: The option to mark index invisible is not yet implemented in MariaDB (afaik!).
Update:
The syntax for MariaDB is different, please see this reference: https://jira.mariadb.org/browse/MDEV-7317
Just to add to those who are using Maria DB with MySQL Workbench, you don't need to install mysql. You can just change 'Default Target MySQL Version' from Preferences to 5.7 or 5.6, and the VISIBLE keyword will be removed by workbench.
Here is a link from mysql bugs
https://bugs.mysql.com/bug.php?id=92269
I am using MySQL Workbench and have same problem. Change in the Preferences but it did not work.
Solution: If you export forward-engineer the model you need to change the configuration on another place.
Go to Model > Model Options
Inside the Model Options, go to MySQL
Then change the "Target MySQL Version" to 5.6

Error - mismatched input 'SWAP' expecting 'REROUTE' in CrateDB for Alter Cluster query

I am upgrading CRATE DB from version 2.x to 3.1.6 as per suggestion when I try to upgrade tables created in version 2.x using document,
https://crate.io/docs/crate/reference/en/latest/admin/system-information.html#tables-need-to-be-upgraded
In step 5,
Query -
alter CLUSTER SWAP table transactions2 to transactions;
I am getting error SQLActionException[SQLParseException: line 1:15: mismatched input 'SWAP' expecting 'REROUTE']
I am not sure what would be the correct query to resolve this.
You are following the latest documentation instead of the e.g. 2.3 (https://crate.io/docs/crate/reference/en/2.3/admin/system-information.html#tables-need-to-be-recreated) documentation version.
The SWAP SQL command support was added in version 3.2, see https://crate.io/docs/crate/reference/en/latest/appendices/release-notes/3.2.0.html#database-administration.

How to use ON DUPLICATE KEY on hsqldb 2.3.4

According to the update on hsqldb.org listed here: http://hsqldb.org/web/features200.html
It now supports the mysql syntax ON DUPLICATE KEY in hsqldb 2.3.4, yet Im still getting sql errors when trying to run it. If im reading correctly I may need to set certain flags. But I cant find what to set to be able to use this synatx.
MySQL compatibility is documented in the Guide http://hsqldb.org/doc/2.0/guide/compatibility-chapt.html#coc_compatibility_mysql
You need to execute SET DATABASE SQL SYNTAX MYS TRUE or the equivalent URL property sql.syntax_mys=true to enable it.

ORA-31655 when using VERSION=10.2 with expdp

i'm trying to export a table with Oracle Datapump, running on a Oracle 12C Instance. The schema has a table called KAT.
When i do the export with:
expdp USER/PASS directory=exp dumpfile=dump.dmp logfile=kat.log TABLES=KAT
everything works as expected.
When i try to do the following (to be able to import the data in a Oracle 10g database), i get the following error:
expdp USER/PASS directory=exp dumpfile=dump.dmp logfile=kat.log TABLES=KAT VERSION=10.2
ORA-39166: Object USER.KAT was not found.
ORA-31655: no data or metadata objects selected for job
Why? Any ideas?
Most likely issue is that your table is using features that exist in 12c but not in 10.2. I'm getting the exact same error message trying to export a table with a virtual column (which were introduced in 11.1) from a 12c database:
No VERSION (i.e. COMPATIBLE): works
VERSION=11.2 or 11.1: works
VERSION=10.2: ORA-39166 error.
Could be a feature on the table itself, or one of its indexes (or constraints). Check the table's DDL.