You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@dolphinscheduler.apache.org by GitBox <gi...@apache.org> on 2021/04/19 02:58:37 UTC

[GitHub] [dolphinscheduler] wen-hemin opened a new issue #5317: [Discuss][JsonSplit] The problem of digital overflow in JS by the design of "code field"

wen-hemin opened a new issue #5317:
URL: https://github.com/apache/dolphinscheduler/issues/5317


   **Describe the question**
   In the design of workflow JSON split, the workflow and task definition table introduce the code and version as the unique identification. The data type of the current code field is 20 integer numbers, and the code algorithm is snowflake algorithm. In the actual development, the number type in JS supports up to 16 bits, and the coding will lose precision in the process of front-end and back-end interaction. There are two solutions to solve this problem
   
   1. The data type of the encoding field is changed to the string type, and the snowflake algorithm generates the number and converts it to the string
   
   2. Reduce the data length of the number generated by the snowflake algorithm, so that the number of digits is less than 16. After reducing the number of digits, it is necessary to ensure that the results are not repeated
   
   I think the first is better, there is a better plan, welcome to discuss.
   
   json split issue: #4417 
   
   **Which version of DolphinScheduler:**
    -[json-split]
   
   ---
   
   JSON拆分设计中,工作流、作业定义表引入了编码和版本作为唯一标识,当前编码字段的数据类型是20位整型数字,编码的算法是雪花算法,实际开发中,JS中数字类型最多支持16位,编码在前后端交互过程中会出现丢失精度问题,解决这个问题有2中方案
   1.编码字段的数据类型修改为字符串类型,雪花算法生成数字后转换为字符串
   2.缩小雪花算法生成数字的数据长度,使数字位数小于16位,缩小位数后需要保证结果不重复


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

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



[GitHub] [dolphinscheduler] chengshiwen edited a comment on issue #5317: [Discuss][JsonSplit] The problem of digital overflow in JS by the design of "code field"

Posted by GitBox <gi...@apache.org>.
chengshiwen edited a comment on issue #5317:
URL: https://github.com/apache/dolphinscheduler/issues/5317#issuecomment-822138731


   I prefer consistency and disambiguation, and the frontend, backend and openapi are unified. Either all of them are unified `string`, or all are unified `long` type, if there is no difference in performance


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

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



[GitHub] [dolphinscheduler] haydenzhourepo commented on issue #5317: [Discuss][JsonSplit] The problem of digital overflow in JS by the design of "code field"

Posted by GitBox <gi...@apache.org>.
haydenzhourepo commented on issue #5317:
URL: https://github.com/apache/dolphinscheduler/issues/5317#issuecomment-822281415


   I prefer storing string type directly so that we can use a uid by combined with a meaningful prefix, which increase the maintainability of the code,  and make it easy to quickly find out the problem by the meaningful prefix.


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

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



[GitHub] [dolphinscheduler] ruanwenjun commented on issue #5317: [Discuss][JsonSplit] The problem of digital overflow in JS by the design of "code field"

Posted by GitBox <gi...@apache.org>.
ruanwenjun commented on issue #5317:
URL: https://github.com/apache/dolphinscheduler/issues/5317#issuecomment-822151959


   I prefer storing the `long` type in the database and using `DTO` to convert to string type required by the front end. This will increase additional costs, but can separate from the storage system.


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

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



[GitHub] [dolphinscheduler] chengshiwen commented on issue #5317: [Discuss][JsonSplit] The problem of digital overflow in JS by the design of "code field"

Posted by GitBox <gi...@apache.org>.
chengshiwen commented on issue #5317:
URL: https://github.com/apache/dolphinscheduler/issues/5317#issuecomment-822138731


   I prefer consistency and disambiguation. The frontend, backend and openapi are unified, either all of them are unified `string`, or all are unified `long` type


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

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



[GitHub] [dolphinscheduler] github-actions[bot] commented on issue #5317: [Discuss][JsonSplit] The problem of digital overflow in JS by the design of "code field"

Posted by GitBox <gi...@apache.org>.
github-actions[bot] commented on issue #5317:
URL: https://github.com/apache/dolphinscheduler/issues/5317#issuecomment-822132766


   Hi:
   * Thank you for your feedback, we have received your issue, Please wait patiently for a reply.
   * In order for us to understand your request as soon as possible, please provide detailed information、version or pictures.
   * If you haven't received a reply for a long time, you can subscribe to the developer's email,Mail subscription steps reference https://dolphinscheduler.apache.org/zh-cn/community/development/subscribe.html ,Then write the issue URL in the email content and send question to dev@dolphinscheduler.apache.org.


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

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



[GitHub] [dolphinscheduler] dailidong commented on issue #5317: [Discuss][JsonSplit] The problem of digital overflow in JS by the design of "code field"

Posted by GitBox <gi...@apache.org>.
dailidong commented on issue #5317:
URL: https://github.com/apache/dolphinscheduler/issues/5317#issuecomment-822140228


   I prefer unified long + primary key unique index


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

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



[GitHub] [dolphinscheduler] wen-hemin closed issue #5317: [Discuss][JsonSplit] The problem of digital overflow in JS by the design of "code field"

Posted by GitBox <gi...@apache.org>.
wen-hemin closed issue #5317:
URL: https://github.com/apache/dolphinscheduler/issues/5317


   


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

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



[GitHub] [dolphinscheduler] wen-hemin commented on issue #5317: [Discuss][JsonSplit] The problem of digital overflow in JS by the design of "code field"

Posted by GitBox <gi...@apache.org>.
wen-hemin commented on issue #5317:
URL: https://github.com/apache/dolphinscheduler/issues/5317#issuecomment-822210744


   Thank everyone
   It is now decided to use option 2.


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

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



[GitHub] [dolphinscheduler] lenboo commented on issue #5317: [Discuss][JsonSplit] The problem of digital overflow in JS by the design of "code field"

Posted by GitBox <gi...@apache.org>.
lenboo commented on issue #5317:
URL: https://github.com/apache/dolphinscheduler/issues/5317#issuecomment-822209427


   > I prefer storing the `long` type in the database and using `DTO` to convert to string type required by the front end. This will increase additional costs, but can separate from the storage system.
   
   +1 
   The data of presentation layer and service layer can be inconsistent
   
   


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

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