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

SQL Syntax error when selecting 'Overwrite only incremental' in creating DB type datasource #1391

Closed
YooYoungmo opened this issue Feb 8, 2019 · 1 comment
Assignees
Labels
bug Something isn't working @datasource Component Name : Datasource/Connection Management
Milestone

Comments

@YooYoungmo
Copy link
Collaborator

YooYoungmo commented Feb 8, 2019

Describe the bug
DB 타입 데이터 소스 생성 시 데이터 조회를 세미 콜론(;)이 포함된 SQL 쿼리로 작성하고 적재 설정을 주기적 수집으로 그리고 수집 데이터 범위를 증감분 데이터으로 선택한 경우 'SQL syntax' 오류 발생

To Reproduce

  1. 소스 타입을 데이터배이스로 선택
    image
  2. 적재 타입을 수집형 데이터 DB를 MySQL로 선택
    image
  3. 쿼리를 선택 후 SQL 마지막에 세미콜론(;) 붙힘
    image
  4. 스키마 구성
    image
  5. 적재 설정을 주기적 수집, 수집 데이터 범위를 증감분 데이터 로 선택
    image
  6. 수집 오류 발생
    image
    image

Additional context

  • Metatron 3.2.0-rc2 에서 테스트
  • 적재 설정에서 수집 데이터 범위를 전체로 선택하면 오류나지 않음
@YooYoungmo
Copy link
Collaborator Author

문제

메타트론 서버 로그를 확인해 보면 SQL 중간에 세미 콜론이 들어가면서 오류가 납니다.

SELECT `sale_record_no`,
       `payment_type`,
       `payment_amt`,
       `in_datetime`
FROM (
SELECT sale_record_no,
       payment_type,
       payment_amt,
       in_datetime
FROM payment;

) AS TTB
WHERE in_datetime >= STR_TO_DATE('1970-01-01 00:00:00', '%Y-%m-%d %T') LIMIT 10000
OFFSET 0

@kyungtaak kyungtaak added this to the 3.2.0 milestone Mar 2, 2019
@kyungtaak kyungtaak added @datasource Component Name : Datasource/Connection Management bug Something isn't working labels Mar 2, 2019
@kyungtaak kyungtaak modified the milestones: 3.2.0, 3.3.0 Mar 31, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working @datasource Component Name : Datasource/Connection Management
Projects
None yet
Development

No branches or pull requests

3 participants