You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@seatunnel.apache.org by "dik111 (via GitHub)" <gi...@apache.org> on 2023/08/24 07:27:30 UTC

[GitHub] [seatunnel] dik111 opened a new issue, #5370: [Bug] [[Connector-V2]][http] Get empty data from json data

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

   ### 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
   
   Hi Teams:
     I try to use connector-v2-http to synchronize http-json data to hive, but I get empty data, where I locate `$.data[*].finishPermissions[*].permissionName`, `$.data[*]. finishPermissions[*].permissionCode` results in empty data, how can I modify the configuration file?
   
   json data:
   ```json
   {
       "errorMsg": null,
       "stateCode": 200,
       "data": [
               {
                   "finishMainCode": "312",
                   "finishCode": "312DHAE",
                   "finishName": "xx",
                   "texture": "无",
                   "greenLevel": "ENF",
                   "createDate": "2023/8/7 9:59:21",
                   "lastUpdateDate": "2023/8/8 10:03:02",
                   "saleState": "在售",
                   "finishPermissions": [
                       {
                           "permissionName": "11",
                           "permissionCode": "22",
                           "brand": "33",
                           "category": "44",
                           "finishCode": "55",
                           "finishName": "66",
                           "finishNickCode": null,
                           "finihsNickName": null,
                           "isUseChest": 1,
                           "isUseBackPannel": 0,
                           "isUseDoor": 0,
                           "isUseWallPannel": 0
                       }
                   ]
               }
       ]}
   ```
   
   ### SeaTunnel Version
   
   2.3.3
   
   ### SeaTunnel Config
   
   ```conf
   env {
       spark.streaming.batchDuration = 5
       spark.app.name = "seatunnel-app-http-hive-spark"
       spark.sql.catalogImplementation = "hive"
       hive.metastore.dml.events = false
       spark.executor.memory=5G
       spark.network.timeout=10000000
       spark.executor.heartbeatInterval=10000000
   job.mode = "BATCH"
   }
   source {
       Http {
       url = "http://xx/finishapi/getFinishSummary"
       method = "GET"
       format = "json"
       json_field = {
         finish_main_code = "$.data[*].finishMainCode"
         finish_code = "$.data[*].finishCode"
         texture = "$.data[*].texture"
         green_level = "$.data[*].greenLevel"
         create_date = "$.data[*].createDate"
         last_update_date = "$.data[*].lastUpdateDate"
         sale_state = "$.data[*].saleState"
         permission_name = "$.data[*].finishPermissions[*].permissionName"
         permission_code = "$.data[*].finishPermissions[*].permissionCode"
       }
       schema = {
         fields {
           finish_main_code = string
           finish_code = string
           texture = string
           green_level = string
           create_date = string
           last_update_date = string
           sale_state = string
           permission_name = string
           permission_code = string
         }
       }
     }
   }
   sink {
       Hive {
           table_name = "test.http_hive_finish"
           save_mode = "overwrite"
           metastore_uri = "thrift://xx:9083"
       }
   }
   transform{}
   ```
   
   
   ### Running Command
   
   ```shell
   bin/start-seatunnel-spark-3-connector-v2.sh --master yarn --deploy-mode client --config ./config/http-hive-finish-spark.conf
   ```
   
   
   ### Error Exception
   
   ```log
   none
   ```
   
   
   ### Zeta or Flink or Spark Version
   
   spark version 3.2.1
   
   ### Java or Scala Version
   
   java 8
   
   ### Screenshots
   
   _No response_
   
   ### Are you willing to submit PR?
   
   - [ ] 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


[GitHub] [seatunnel] liugddx commented on issue #5370: [Bug] [[Connector-V2][http] Get empty data from json data

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

   Based on your configuration, I found that you need two levels of data.If you only get the data in `finishPermissions`, there is no problem.
   
   


-- 
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] [[Connector-V2][http] Get empty data from json data [seatunnel]

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

   is this bug fix now ?


-- 
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


[GitHub] [seatunnel] chen0623-bak commented on issue #5370: [Bug] [[Connector-V2][http] Get empty data from json data

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

   i get


-- 
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


[GitHub] [seatunnel] dik111 commented on issue #5370: [Bug] [[Connector-V2][http] Get empty data from json data

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

   > > I think he can work normally I use `express` as the server for quick testing ![image](https://user-images.githubusercontent.com/77488507/265640881-be1c2e37-76a7-469c-9947-67eb2fbcba93.png)
   > > And the results were obtained normally ![image](https://user-images.githubusercontent.com/77488507/265643136-64ccad83-0920-47b8-97d7-34c8d712fc65.png)
   > > this my conf
   > > ```
   > > env {
   > >     job.mode = "STREAMING"
   > >     execution.parallelism = 1
   > > }
   > > source {
   > >     Http {
   > >     poll_interval_ms = 5000
   > >     url = "http://192.168.195.248:3000"
   > >     method = "GET"
   > >     format = "json"
   > >     json_field = {
   > >       finish_main_code = "$.data[*].finishMainCode"
   > >       finish_code = "$.data[*].finishCode"
   > >       texture = "$.data[*].texture"
   > >       green_level = "$.data[*].greenLevel"
   > >       create_date = "$.data[*].createDate"
   > >       last_update_date = "$.data[*].lastUpdateDate"
   > >       sale_state = "$.data[*].saleState"
   > >       permission_name = "$.data[*].finishPermissions[*].permissionName"
   > >       permission_code = "$.data[*].finishPermissions[*].permissionCode"
   > >     }
   > >     schema = {
   > >       fields {
   > >         finish_main_code = string
   > >         finish_code = string
   > >         texture = string
   > >         green_level = string
   > >         create_date = string
   > >         last_update_date = string
   > >         sale_state = string
   > >         permission_name = string
   > >         permission_code = string
   > >       }
   > >     }
   > >   }
   > > }
   > > sink {
   > >     Console{}
   > > }
   > > transform{}
   > > ```
   > > 
   > > 
   > >     
   > >       
   > >     
   > > 
   > >       
   > >     
   > > 
   > >     
   > >   
   > > > I found that when I set poll_interval_ms=5000
   > > > But he didn't output every 5 seconds as expected
   > > > It's just crazy printing
   > > > I think it should be a bug
   > 
   > If the length of finishPermissions>1, the task will not get data.
   
   You are right, when finishPermissions>1, the data will be empty, and I found that when engine is spark on yarn, finishPermissions=1 data will also be empty (engine is not empty for seatunnel)


-- 
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


[GitHub] [seatunnel] liugddx commented on issue #5370: [Bug] [[Connector-V2][http] Get empty data from json data

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

   > I think I found the reason Written on the official website as poll_interval_ms The source code says poll_interval_millis
   > 
   > Can you wait for me to go home and submit a PR I also want to become a contributor
   
   Of course you can contribute, I look forward to your PR!


-- 
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


[GitHub] [seatunnel] liugddx commented on issue #5370: [Bug] [[Connector-V2][http] Get empty data from json data

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

   ![image](https://github.com/apache/seatunnel/assets/48236177/40b34e27-154c-4a30-a058-a92de1143dcb)
   
   Since the number of data pieces in these two parts is inconsistent, no data is taken out.


-- 
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


[GitHub] [seatunnel] liugddx commented on issue #5370: [Bug] [[Connector-V2][http] Get empty data from json data

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

   > I think he can work normally I use `express` as the server for quick testing ![image](https://user-images.githubusercontent.com/77488507/265640881-be1c2e37-76a7-469c-9947-67eb2fbcba93.png)
   > 
   > And the results were obtained normally ![image](https://user-images.githubusercontent.com/77488507/265643136-64ccad83-0920-47b8-97d7-34c8d712fc65.png)
   > 
   > this my conf
   > 
   > ```
   > env {
   >     job.mode = "STREAMING"
   >     execution.parallelism = 1
   > }
   > source {
   >     Http {
   >     poll_interval_ms = 5000
   >     url = "http://192.168.195.248:3000"
   >     method = "GET"
   >     format = "json"
   >     json_field = {
   >       finish_main_code = "$.data[*].finishMainCode"
   >       finish_code = "$.data[*].finishCode"
   >       texture = "$.data[*].texture"
   >       green_level = "$.data[*].greenLevel"
   >       create_date = "$.data[*].createDate"
   >       last_update_date = "$.data[*].lastUpdateDate"
   >       sale_state = "$.data[*].saleState"
   >       permission_name = "$.data[*].finishPermissions[*].permissionName"
   >       permission_code = "$.data[*].finishPermissions[*].permissionCode"
   >     }
   >     schema = {
   >       fields {
   >         finish_main_code = string
   >         finish_code = string
   >         texture = string
   >         green_level = string
   >         create_date = string
   >         last_update_date = string
   >         sale_state = string
   >         permission_name = string
   >         permission_code = string
   >       }
   >     }
   >   }
   > }
   > sink {
   >     Console{}
   > }
   > transform{}
   > ```
   > 
   > > I found that when I set poll_interval_ms=5000
   > > But he didn't output every 5 seconds as expected
   > > It's just crazy printing
   > > I think it should be a bug
   
   If the length of finishPermissions>1, the task will not get data. 


-- 
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


[GitHub] [seatunnel] chen0623-bak commented on issue #5370: [Bug] [[Connector-V2][http] Get empty data from json data

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

   when finishPermissions>1, the data will be empty
   My superficial opinion
   
   I have a JSON
   ```json
   [
       { "x":1, "y":2},
       { "x":3,"y":4}
   ]
   ```
   When I parse with xpath
   ```
   $.data[*].x
   $.data[*].y
   ```
   I get resut
   ```
   List(List(1,3),List(2,4))
   ```
   But i want
   ```
   List(List(1,2),List(3,4))
   ```
   Like this
   ![image](https://github.com/apache/seatunnel/assets/77488507/da0166ad-b62f-4d3f-8176-829777a2f9a1)
   
   Make sure that the length of each element is equal
   
   


-- 
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


[GitHub] [seatunnel] dik111 commented on issue #5370: [Bug] [[Connector-V2][http] Get empty data from json data

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

   > 
   
   Does seatunnel  now support the two Levels of Data in the same job?


-- 
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


[GitHub] [seatunnel] liugddx commented on issue #5370: [Bug] [[Connector-V2][http] Get empty data from json data

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

   > > 
   > 
   > Does seatunnel now support the two Levels of Data in the same job?
   
   Not yet
   


-- 
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] [[Connector-V2][http] Get empty data from json data [seatunnel]

Posted by "liugddx (via GitHub)" <gi...@apache.org>.
liugddx closed issue #5370: [Bug] [[Connector-V2][http] Get empty data from json data
URL: https://github.com/apache/seatunnel/issues/5370


-- 
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


[GitHub] [seatunnel] chen0623-bak commented on issue #5370: [Bug] [[Connector-V2][http] Get empty data from json data

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

   I think I found the reason
   Written on the official website as poll_interval_ms
   The source code says poll_interval_millis


-- 
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


[GitHub] [seatunnel] chen0623-bak commented on issue #5370: [Bug] [[Connector-V2][http] Get empty data from json data

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

   I think he can work normally
   I use `express` as the server for quick testing
   ![image](https://github.com/apache/seatunnel/assets/77488507/be1c2e37-76a7-469c-9947-67eb2fbcba93)
   
   And the results were obtained normally
   ![image](https://github.com/apache/seatunnel/assets/77488507/64ccad83-0920-47b8-97d7-34c8d712fc65)
   
   
   this my conf
   ```
   env {
       job.mode = "STREAMING"
       execution.parallelism = 1
   }
   source {
       Http {
       poll_interval_ms = 100000
       url = "http://192.168.195.248:3000"
       method = "GET"
       format = "json"
       json_field = {
         finish_main_code = "$.data[*].finishMainCode"
         finish_code = "$.data[*].finishCode"
         texture = "$.data[*].texture"
         green_level = "$.data[*].greenLevel"
         create_date = "$.data[*].createDate"
         last_update_date = "$.data[*].lastUpdateDate"
         sale_state = "$.data[*].saleState"
         permission_name = "$.data[*].finishPermissions[*].permissionName"
         permission_code = "$.data[*].finishPermissions[*].permissionCode"
       }
       schema = {
         fields {
           finish_main_code = string
           finish_code = string
           texture = string
           green_level = string
           create_date = string
           last_update_date = string
           sale_state = string
           permission_name = string
           permission_code = string
         }
       }
     }
   }
   sink {
       Console{}
   }
   transform{}
   ```
   >I found that when I set poll_interval_ms=5000
   >But he didn't output every 5 seconds as expected
   >It's just crazy printing
   >I think it should be a 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