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

psycopg2.errors.SyntaxError: each UNION query must have the same number of columns #10

Closed
pcoccoli opened this issue Jul 2, 2021 · 0 comments · Fixed by #11
Closed
Assignees
Labels
bug Something isn't working

Comments

@pcoccoli
Copy link
Collaborator

pcoccoli commented Jul 2, 2021

Traceback (most recent call last):
  File "/home/pcoccoli/.pyenv/versions/gh392/bin/kestrel", line 7, in <module>
    exec(compile(f.read(), __file__, 'exec'))
  File "/home/pcoccoli/github/kestrel-lang/bin/kestrel", line 8, in <module>
    runpy.run_module('kestrel', run_name='__main__')
  File "/home/pcoccoli/.pyenv/versions/3.9.2/lib/python3.9/runpy.py", line 213, in run_module
    return _run_code(code, {}, init_globals, run_name, mod_spec)
  File "/home/pcoccoli/.pyenv/versions/3.9.2/lib/python3.9/runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "/home/pcoccoli/github/kestrel-lang/src/kestrel/__main__.py", line 54, in <module>
    outputs = session.execute(huntflow)
  File "/home/pcoccoli/github/kestrel-lang/src/kestrel/session.py", line 262, in execute
    return self._execute_ast(ast)
  File "/home/pcoccoli/github/kestrel-lang/src/kestrel/session.py", line 437, in _execute_ast
    output_var_struct, display = execute_cmd(stmt, self)
  File "/home/pcoccoli/github/kestrel-lang/src/kestrel/codegen/commands.py", line 92, in wrapper
    return func(stmt, session)
  File "/home/pcoccoli/github/kestrel-lang/src/kestrel/codegen/commands.py", line 60, in wrapper
    ret = func(stmt, session)
  File "/home/pcoccoli/github/kestrel-lang/src/kestrel/codegen/commands.py", line 262, in get
    session.store.merge(
  File "/home/pcoccoli/github/firepit/firepit/sqlstorage.py", line 532, in merge
    cursor = self._create_view(viewname, stmt, sco_type, deps=input_views)
  File "/home/pcoccoli/github/firepit/firepit/pgstorage.py", line 141, in _create_view
    self._execute(f'CREATE OR REPLACE VIEW "{viewname}" AS {select}', cursor)
  File "/home/pcoccoli/github/firepit/firepit/sqlstorage.py", line 82, in _execute
    cursor.execute(statement)
  File "/home/pcoccoli/.pyenv/versions/3.9.2/envs/gh392/lib/python3.9/site-packages/psycopg2/extras.py", line 236, in execute
    return super().execute(query, vars)
psycopg2.errors.SyntaxError: each UNION query must have the same number of columns
LINE 43: ...mbership.var = 'cmd_local'::text))) UNION  SELECT process.ty...
                                                              ^
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
1 participant