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

sqlalchemy.exc.ProgrammingError: (_mysql_exceptions.ProgrammingError) (1064, "You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'max), #47

Open
amitasthana opened this issue Feb 14, 2019 · 0 comments

Comments

@amitasthana
Copy link

ETLAlchemySource (INFO) - Transferring data from local file 'HJL____MASTER.sql' to target DB
ETLAlchemySource (INFO) - Sending data to target MySQL instance...(Fast [mysqlimport])
ETLAlchemySource (INFO) - mysqlimport -v -hlocalhost -utejora -ptejora --compress --local --fields-terminated-by="," --fields-enclosed-by='"' --fields-escaped-by='' --lines-terminated-by="
" cron /code_path/etlalchemy/HJL____MASTER.sql
mysqlimport: [Warning] Using a password on the command line interface can be insecure.
Connecting to localhost
Selecting database cron
Loading data from LOCAL file: /code_path/etlalchemy/HJL____MASTER.sql into HJL____MASTER
cron.HJL____MASTER: Records: 102 Deleted: 0 Skipped: 0 Warnings: 0
Disconnecting from localhost
ETLAlchemySource (INFO) - Done.
ETLAlchemySource (INFO) - Cleaning up 'HJL____MASTER'.sql
ETLAlchemySource (INFO) - Done
ETLAlchemySource (INFO) - Reading Table Schema 'B_______INDIES'...
ETLAlchemySource (INFO) - Loaded indexes and FKs for table 'B_______INDIES'
ETLAlchemySource (WARNING) - Table 'B_______INDIES' does not exist in the dst database (we will create this later...)
ETLAlchemySource (INFO) - Building query to fetch all rows from B_______INDIES
ETLAlchemySource (INFO) - Done. (462 total rows)
ETLAlchemySource (INFO) - Loading all rows into memory...
ETLAlchemySource (INFO) - Done
ETLAlchemySource (INFO) - (SOME_CODE) NUMERIC
ETLAlchemySource (INFO) - Bases: ['NUMERIC']
ETLAlchemySource (INFO) - --> SOME_CODE...{'Decimal': 462}
ETLAlchemySource (WARNING) - Column 'SOME_CODE' is of type 'Decimal', but contains no mantissas > 0. (i.e. 3.00, 2.00, etc..)

ETLAlchemySource (WARNING) - Coercing to 'Integer'
ETLAlchemySource (INFO) - Checking column for elimination status...
ETLAlchemySource (INFO) - (SOME_XName) VARCHAR
ETLAlchemySource (INFO) - Bases: ['STRING']
ETLAlchemySource (INFO) - Checking column for elimination status...
ETLAlchemySource (INFO) - (SOME_ISIN) VARCHAR
ETLAlchemySource (INFO) - Bases: ['STRING']
ETLAlchemySource (INFO) - Checking column for elimination status...
ETLAlchemySource (INFO) - (Scheme_id) VARCHAR
ETLAlchemySource (INFO) - Bases: ['STRING']
ETLAlchemySource (INFO) - Checking column for elimination status...
ETLAlchemySource (INFO) - (GHJ Mapped) NVARCHAR
ETLAlchemySource (INFO) - Bases: ['UNICODE']
ETLAlchemySource (INFO) - Checking column for elimination status...
ETLAlchemySource (INFO) - --> Creating table 'B_______INDIES'
ETLAlchemySource (ERROR) - Failed to create table 'B_______INDIES'

(_mysql_exceptions.ProgrammingError) (1064, "You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'max), \n\tGHJ Mapped VARCHAR(550)\n)' at line 5") [SQL: u'\nCREATE TABLE B_______INDIES (\n\tSOME_CODE INTEGER NOT NULL, \n\tSOME_XName VARCHAR(100) NOT NULL, \n\tSOME_ISIN VARCHAR(50), \n\tScheme_id VARCHAR(max), \n\tGHJ Mapped VARCHAR(550)\n)\n\n']
Traceback (most recent call last):
File "test23.py", line 32, in
target.migrate()
File "/some_path/python2.7/site-packages/etlalchemy/ETLAlchemyTarget.py", line 86, in migrate
migrate_data=migrate_data)
File "/some_path/python2.7/site-packages/etlalchemy/ETLAlchemySource.py", line 1073, in migrate
tableCreationSuccess = self.create_table(T_dst_exists, T)
File "/some_path/python2.7/site-packages/etlalchemy/ETLAlchemySource.py", line 590, in create_table
T.create(conn)
File "/some_path/python2.7/site-packages/sqlalchemy/sql/schema.py", line 725, in create
checkfirst=checkfirst)
File "/some_path/python2.7/site-packages/sqlalchemy/engine/base.py", line 1481, in _run_visitor
**kwargs).traverse_single(element)
File "/some_path/python2.7/site-packages/sqlalchemy/sql/visitors.py", line 121, in traverse_single
return meth(obj, **kw)
File "/some_path/python2.7/site-packages/sqlalchemy/sql/ddl.py", line 764, in visit_table
include_foreign_key_constraints=include_foreign_key_constraints
File "/some_path/python2.7/site-packages/sqlalchemy/engine/base.py", line 914, in execute
return meth(self, multiparams, params)
File "/some_path/python2.7/site-packages/sqlalchemy/sql/ddl.py", line 68, in _execute_on_connection
return connection._execute_ddl(self, multiparams, params)
File "/some_path/python2.7/site-packages/sqlalchemy/engine/base.py", line 968, in _execute_ddl
compiled
File "/some_path/python2.7/site-packages/sqlalchemy/engine/base.py", line 1146, in _execute_context
context)
File "/some_path/python2.7/site-packages/sqlalchemy/engine/base.py", line 1341, in _handle_dbapi_exception
exc_info
File "/some_path/python2.7/site-packages/sqlalchemy/util/compat.py", line 202, in raise_from_cause
reraise(type(exception), exception, tb=exc_tb, cause=cause)
File "/some_path/python2.7/site-packages/sqlalchemy/engine/base.py", line 1139, in _execute_context
context)
File "/some_path/python2.7/site-packages/sqlalchemy/engine/default.py", line 450, in do_execute
cursor.execute(statement, parameters)
File "/some_path/python2.7/site-packages/MySQLdb/cursors.py", line 205, in execute
self.errorhandler(self, exc, value)
File "/some_path/python2.7/site-packages/MySQLdb/connections.py", line 36, in defaulterrorhandler
raise errorclass, errorvalue
sqlalchemy.exc.ProgrammingError: (_mysql_exceptions.ProgrammingError) (1064, "You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'max), \n\tGHJ Mapped VARCHAR(550)\n)' at line 5") [SQL: u'\nCREATE TABLE B_______INDIES (\n\tSOME_CODE INTEGER NOT NULL, \n\tSOME_XName VARCHAR(100) NOT NULL, \n\tSOME_ISIN VARCHAR(50), \n\tScheme_id VARCHAR(max), \n\tGHJ Mapped VARCHAR(550)\n)\n\n']

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