You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@seatunnel.apache.org by "zhangshenghang (via GitHub)" <gi...@apache.org> on 2024/09/02 12:40:36 UTC

[I] [Bug] [transforms] [SQL] SQL engine conditional query error [seatunnel]

zhangshenghang opened a new issue, #7552:
URL: https://github.com/apache/seatunnel/issues/7552

   ### Search before asking
   
   - [X] I had searched in the [issues](https://github.com/apache/seatunnel/issues?q=is%3Aissue+label%3A%22bug%22) and found no similar issues.
   
   
   ### What happened
   
   SQL engine conditional query error, when using the 'where name='abc' string equal to the query, it cannot take effect because of a logical judgment error.
   
   ### SeaTunnel Version
   
   dev
   
   ### SeaTunnel Config
   
   ```conf
   env {
     job.mode = "BATCH"
     job.name = "this_is_a_job_name"
     parallelism = 2
   }
   
   source {
     FakeSource {
       result_table_name = "fake"
       row.num = 10
       string.template = ['abc','d~f','hi']
       int.template = [20, 21]
       schema = {
         fields {
           name = "string"
           age = "int"
         }
       }
     }
   }
   
   transform {
       sql {
         source_table_name = "fake"
         result_table_name = "sql"
         query = "select * from "fake" where name = 'abc' "
       }
   
   }
   
   sink {
     Console {
        source_table_name = "sql"
        username = "seatunnel=2.3.1"
           password = "$a^b%c.d~e0*9("
       }
   }
   ```
   
   
   ### Running Command
   
   ```shell
   bin/seatunnel.sh
   ```
   
   
   ### Error Exception
   
   ```log
   query error
   ```
   
   
   ### Zeta or Flink or Spark Version
   
   _No response_
   
   ### Java or Scala Version
   
   _No response_
   
   ### Screenshots
   
   _No response_
   
   ### Are you willing to submit PR?
   
   - [X] Yes I am willing to submit a PR!
   
   ### Code of Conduct
   
   - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@seatunnel.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] [Bug] [transforms] [SQL] SQL engine conditional query error [seatunnel]

Posted by "liunaijie (via GitHub)" <gi...@apache.org>.
liunaijie commented on issue #7552:
URL: https://github.com/apache/seatunnel/issues/7552#issuecomment-2325404272

   I rember this can work before, do we know which pr has bug?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@seatunnel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] [Bug] [transforms] [SQL] SQL engine conditional query error [seatunnel]

Posted by "liunaijie (via GitHub)" <gi...@apache.org>.
liunaijie commented on issue #7552:
URL: https://github.com/apache/seatunnel/issues/7552#issuecomment-2325442106

   > Yes, I have identified this issue, which can also occur here. I will try to fix it
   > 
   > ```
   > / bin/seatunnel.sh -c <this_config_file> 
   > -i jobName='this_is_a_job_name' 
   > -i resName=fake 
   > -i rowNum=10 
   > -i strTemplate=['abc','d~f','hi'] 
   > -i nameType=string 
   > -i nameVal=abc 
   > -i username=seatunnel=2.3.1 
   > -i password='$a^b%c.d~e0*9(' 
   > -m local
   > ```
   
   Hi, i noticed you using the variable replacement. 
   now there has a known issue, the variable value can't has space.
   
   like `-i nameVal='a bc'` , then we will only receive `nameVal=a`.
   we can add quota on start script, but in `seatunnel.sh` when it run `java xxxx -i ` command, it will lose the quota.   FYR.
   
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@seatunnel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] [Bug] [transforms] [SQL] SQL engine conditional query error [seatunnel]

Posted by "zhangshenghang (via GitHub)" <gi...@apache.org>.
zhangshenghang commented on issue #7552:
URL: https://github.com/apache/seatunnel/issues/7552#issuecomment-2325530288

   > > Yes, I have identified this issue, which can also occur here. I will try to fix it
   > > ```
   > > / bin/seatunnel.sh -c <this_config_file> 
   > > -i jobName='this_is_a_job_name' 
   > > -i resName=fake 
   > > -i rowNum=10 
   > > -i strTemplate=['abc','d~f','hi'] 
   > > -i nameType=string 
   > > -i nameVal=abc 
   > > -i username=seatunnel=2.3.1 
   > > -i password='$a^b%c.d~e0*9(' 
   > > -m local
   > > ```
   > 
   > Hi, i noticed you using the variable replacement. now there has a known issue, the variable value can't has space.
   > 
   > like `-i nameVal='a bc'` , then we will only receive `nameVal=a`. we can add quota on start script, but in `seatunnel.sh` when it run `java xxxx -i ` command, it will lose the quota. FYR.
   
   - link https://github.com/apache/seatunnel/issues/6840


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@seatunnel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] [Bug] [transforms] [SQL] SQL engine conditional query error [seatunnel]

Posted by "zhangshenghang (via GitHub)" <gi...@apache.org>.
zhangshenghang commented on issue #7552:
URL: https://github.com/apache/seatunnel/issues/7552#issuecomment-2325436309

   Yes, I have identified this issue, which can also occur here. I will try to fix it
   ```
   / bin/seatunnel.sh -c <this_config_file> 
   -i jobName='this_is_a_job_name' 
   -i resName=fake 
   -i rowNum=10 
   -i strTemplate=['abc','d~f','hi'] 
   -i nameType=string 
   -i nameVal=abc 
   -i username=seatunnel=2.3.1 
   -i password='$a^b%c.d~e0*9(' 
   -m local
   ```


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@seatunnel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] [Bug] [transforms] [SQL] SQL engine conditional query error [seatunnel]

Posted by "zhangshenghang (via GitHub)" <gi...@apache.org>.
zhangshenghang closed issue #7552: [Bug] [transforms] [SQL] SQL engine conditional query error
URL: https://github.com/apache/seatunnel/issues/7552


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@seatunnel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] [Bug] [transforms] [SQL] SQL engine conditional query error [seatunnel]

Posted by "zhangshenghang (via GitHub)" <gi...@apache.org>.
zhangshenghang commented on issue #7552:
URL: https://github.com/apache/seatunnel/issues/7552#issuecomment-2326507695

   Use 
   ```
   string.template=["abc", "d~f", "hi"]---- here need double quota
   ```
   Can solve the problem, cannot use ' . 
   Single quotation marks will be treated as strings


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@seatunnel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] [Bug] [transforms] [SQL] SQL engine conditional query error [seatunnel]

Posted by "liunaijie (via GitHub)" <gi...@apache.org>.
liunaijie commented on issue #7552:
URL: https://github.com/apache/seatunnel/issues/7552#issuecomment-2325434942

   > I rember this can work before, do we know which pr has bug?
   
   In version 2.3.5, this config can work.
   
   ```
   env {
     job.mode = "BATCH"
     job.name = "this_is_a_job_name"
     parallelism = 2
   }
   
   source {
     FakeSource {
       result_table_name = "fake"
       row.num = 10
       string.template = ["abc","d~f","hi"]            ----  here need double quota
       int.template = [20, 21]
       schema = {
         fields {
           name = "string"
           age = "int"
         }
       }
     }
   }
   
   transform {
       sql {
         source_table_name = "fake"
         result_table_name = "sql"
         query = "select * from "fake" where name = 'abc' "
       }
   
   }
   
   sink {
     Console {
        source_table_name = "sql"
        username = "seatunnel=2.3.1"
           password = "$a^b%c.d~e0*9("
       }
   }
   ```
   
   
   But if the string.template value use single quota, it will get same issue.
   
   
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@seatunnel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org