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 in MySQL query generation #7

Closed
nihxdr opened this issue Sep 18, 2024 · 0 comments
Closed

Error in MySQL query generation #7

nihxdr opened this issue Sep 18, 2024 · 0 comments

Comments

@nihxdr
Copy link
Contributor

nihxdr commented Sep 18, 2024

DDN version: 2.5.0
MySQL ndc version: 1.0.1


Following is the MySQL query generated,

select json_object('rows', (
    select json_arrayagg(json_object(
        'id', id,
        'mode', mode,
        'courseId', course_id
    ))
    from (
        select
        <connector_name>.<table_name>.id as id,
        <connector_name>.<table_name>.mode as mode,
        <connector_name>.<table_name>.course_id as courseId
        from <connector_name>.<table_name>
        where <connector_name>.<table_name>.mode = 'audit'
        group by <connector_name>.<table_name>.id, <connector_name>.<table_name>.mode, <connector_name>.<table_name>.course_id
    ) as <table_name>
))

and this gives following error log:

{
  "timestamp": "2024-09-18T03:26:24.057838179Z",
  "level": "ERROR",
  "message": "Uncaught exception",
  "exception": {
    "exceptionType": "org.jooq.exception.DataAccessException",
    "message": "SQL [select json_object('rows', (select json_arrayagg(json_object('id', id, 'mode', mode, 'courseId', course_id)) from (select <connector_name>.<table_name>.id as id, <connector_name>.<table_name>.mode as mode, <connector_name>.<table_name>.course_id as courseId from <connector_name>.<table_name> where <connector_name>.<table_name>.mode = 'audit' group by <connector_name>.<table_name>.id, <connector_name>.<table_name>.mode, <connector_name>.<table_name>.course_id) as <table_name>))]; Unknown column 'course_id' in 'field list'"
  }
}

This might have caused the issue:

GavinRay97 added a commit that referenced this issue Sep 23, 2024
fix: Modified the DSL.jsonEntry (closes #7)
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