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

MATERIALIZE VIEWS does not work for MySQL #1565

Closed
gokhankiyga opened this issue Mar 13, 2024 · 2 comments
Closed

MATERIALIZE VIEWS does not work for MySQL #1565

gokhankiyga opened this issue Mar 13, 2024 · 2 comments

Comments

@gokhankiyga
Copy link

LOAD DATABASE
FROM mysql://root:password@localhost/tpch
INTO postgresql://postgres:password@localhost/tpch_replica
WITH CREATE NO TABLES

INCLUDING ONLY TABLE NAMES LIKE 'lineitem','orders'

ALTER TABLE NAMES matching 'pgorders_view' rename to 'pgorders'

MATERIALIZE VIEWS 'pgorders_view' AS $$ select l.L_ORDERKEY,l.L_LINENUMBER,l.L_QUANTITY,l.L_DISCOUNT,
l.L_TAX,l.L_SHIPDATE,l.L_RECEIPTDATE,l.L_SHIPMODE,o.O_ORDERDATE,o.O_ORDERSTATUS from tpch.lineitem l join tpch.orders o on l.L_ORDERKEY = o.O_ORDERKEY; $$
;

These code throws error :
KABOOM!
ESRAP-PARSE-ERROR: At

MATERIALIZE VIEWS 'pgord
^ (Line 11, Column 0, Position 294)

In context COMMAND:

While parsing COMMAND. Expected:

 the character Tab

or the character Newline
or the character Return
or the character Space
or the string "--"
or the string "/*"
or the character ; (SEMICOLON)
or the string "after"
or the string "alter"
or the string "before"
or the string "cast"
or the string "excluding"
or the string "including"
or the string "set"
or the string "with"
I CANT UNDERSTAND WHY?
Also;
According to the documentation including only table names matching is used for filtering the table but pgloader throws error to ask to use like rather than matching. I did not understand that also. After changing matching to like it jump the error.

@gokhankiyga
Copy link
Author

Versions of tools:
pgloader version "3.6.9"
compiled with SBCL 2.3.4
PostgreSQL 16.2
Mysql 8.3.0

@gokhankiyga
Copy link
Author

If your password contains @ character pgloader detects mysql connectionn as sqlite so It ask Like rather than matching and does not understand MATERIALIZE VIEW keyword.

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

1 participant