You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by GitBox <gi...@apache.org> on 2020/02/17 16:44:44 UTC

[GitHub] [incubator-doris] wutiangan opened a new pull request #2925: fix bug: Error of exporting double type data to hdfs (#2924)

wutiangan opened a new pull request #2925: fix bug: Error of exporting double type data to hdfs (#2924)
URL: https://github.com/apache/incubator-doris/pull/2925
 
 
   

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


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


[GitHub] [incubator-doris] imay merged pull request #2925: fix bug: Error of exporting double type data to hdfs (#2924)

Posted by GitBox <gi...@apache.org>.
imay merged pull request #2925: fix bug: Error of exporting double type data to hdfs (#2924)
URL: https://github.com/apache/incubator-doris/pull/2925
 
 
   

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


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


[GitHub] [incubator-doris] wutiangan commented on issue #2925: fix bug: Error of exporting double type data to hdfs (#2924)

Posted by GitBox <gi...@apache.org>.
wutiangan commented on issue #2925: fix bug: Error of exporting double type data to hdfs (#2924)
URL: https://github.com/apache/incubator-doris/pull/2925#issuecomment-587246903
 
 
   fix bug: Error of exporting double type data to hdfs (#2924) 

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


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


[GitHub] [incubator-doris] kangpinghuang commented on issue #2925: fix bug: Error of exporting double type data to hdfs (#2924)

Posted by GitBox <gi...@apache.org>.
kangpinghuang commented on issue #2925: fix bug: Error of exporting double type data to hdfs (#2924)
URL: https://github.com/apache/incubator-doris/pull/2925#issuecomment-587260325
 
 
   pls add some description for this pr and add some comment for this modification.

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


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


[GitHub] [incubator-doris] kangpinghuang commented on a change in pull request #2925: fix bug: Error of exporting double type data to hdfs (#2924)

Posted by GitBox <gi...@apache.org>.
kangpinghuang commented on a change in pull request #2925: fix bug: Error of exporting double type data to hdfs (#2924)
URL: https://github.com/apache/incubator-doris/pull/2925#discussion_r380438126
 
 

 ##########
 File path: be/src/runtime/export_sink.cpp
 ##########
 @@ -142,10 +142,10 @@ Status ExportSink::gen_row_buffer(TupleRow* row, std::stringstream* ss) {
                     (*ss) << reinterpret_cast<PackedInt128*>(item)->value;
                     break;
                 case TYPE_FLOAT:
-                    (*ss) << *static_cast<float*>(item);
+                    (*ss) << std::to_string(*static_cast<float*>(item));
                     break;
                 case TYPE_DOUBLE:
-                    (*ss) << *static_cast<double*>(item);
+                    (*ss) << std::to_string(*static_cast<double*>(item));
 
 Review comment:
   why?

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


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


[GitHub] [incubator-doris] imay commented on a change in pull request #2925: fix bug: Error of exporting double type data to hdfs (#2924)

Posted by GitBox <gi...@apache.org>.
imay commented on a change in pull request #2925: fix bug: Error of exporting double type data to hdfs (#2924)
URL: https://github.com/apache/incubator-doris/pull/2925#discussion_r380665345
 
 

 ##########
 File path: be/src/runtime/export_sink.cpp
 ##########
 @@ -142,10 +142,10 @@ Status ExportSink::gen_row_buffer(TupleRow* row, std::stringstream* ss) {
                     (*ss) << reinterpret_cast<PackedInt128*>(item)->value;
                     break;
                 case TYPE_FLOAT:
-                    (*ss) << *static_cast<float*>(item);
+                    (*ss) << std::to_string(*static_cast<float*>(item));
 
 Review comment:
   Please use FloatToBuffer(gutil/strings/numbers.h) to print float and double value

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


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


[GitHub] [incubator-doris] lingbin commented on a change in pull request #2925: fix bug: Error of exporting double type data to hdfs (#2924)

Posted by GitBox <gi...@apache.org>.
lingbin commented on a change in pull request #2925: fix bug: Error of exporting double type data to hdfs (#2924)
URL: https://github.com/apache/incubator-doris/pull/2925#discussion_r380438645
 
 

 ##########
 File path: be/src/runtime/export_sink.cpp
 ##########
 @@ -142,10 +142,10 @@ Status ExportSink::gen_row_buffer(TupleRow* row, std::stringstream* ss) {
                     (*ss) << reinterpret_cast<PackedInt128*>(item)->value;
                     break;
                 case TYPE_FLOAT:
-                    (*ss) << *static_cast<float*>(item);
+                    (*ss) << std::to_string(*static_cast<float*>(item));
 
 Review comment:
   Could you please add a comment to tell the reader why it was converted to a string first?
   
   For example the following comment:
   
   To prevent loss of precision on `float` and `double` types, they are converted to strings before output.
   For example: For a double value `27361919854.929001`, the direct output of using `std::stringstream` is` 2.73619e + 10`, and after conversion to a string, it outputs `27361919854.929001`

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


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org