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

GH-36433: [C++] Update fast_float version to 3.10.1 #36434

Merged
merged 18 commits into from
Jul 19, 2023

Conversation

xxlaykxx
Copy link
Contributor

@xxlaykxx xxlaykxx commented Jul 2, 2023

Rationale for this change

Need this for parsing Infinity values with + sign.

What changes are included in this PR?

updated version of fast_float to version 3.10.1 (used this version because in higher versions c++ 20 started using that cause a lot of build errors)

Are these changes tested?

in scope of fast_float.

Are there any user-facing changes?

no

@github-actions
Copy link

github-actions bot commented Jul 2, 2023

⚠️ GitHub issue #36433 has been automatically assigned in GitHub to PR creator.

Copy link
Member

@kou kou left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you also update version information in cpp/src/arrow/vendored/fast_float/README.md?
(It's better that you update cpp/src/arrow/vendored/fast_float/update.sh to update README.md automatically.)

Could you fix build error?

https://ci.appveyor.com/project/ApacheSoftwareFoundation/arrow/builds/47446241#L1415

FAILED: src/arrow/CMakeFiles/arrow_shared.dir/Unity/unity_12_cxx.cxx.obj 
C:\Miniconda38-x64\envs\arrow\Library\bin\ccache.exe C:\PROGRA~2\MICROS~1\2019\COMMUN~1\VC\Tools\MSVC\1429~1.301\bin\Hostx64\x64\cl.exe  /nologo /TP -DABSL_CONSUME_DLL -DARROW_EXPORTING -DARROW_HAVE_RUNTIME_AVX2 -DARROW_HAVE_RUNTIME_AVX512 -DARROW_HAVE_RUNTIME_BMI2 -DARROW_HAVE_RUNTIME_SSE4_2 -DARROW_HAVE_SSE4_2 -DARROW_HDFS -DARROW_MIMALLOC -DARROW_S3_HAS_CRT -DARROW_WITH_BROTLI -DARROW_WITH_BZ2 -DARROW_WITH_LZ4 -DARROW_WITH_RE2 -DARROW_WITH_SNAPPY -DARROW_WITH_UTF8PROC -DARROW_WITH_ZLIB -DARROW_WITH_ZSTD -DAWS_AUTH_USE_IMPORT_EXPORT -DAWS_CAL_USE_IMPORT_EXPORT -DAWS_CHECKSUMS_USE_IMPORT_EXPORT -DAWS_COMMON_USE_IMPORT_EXPORT -DAWS_COMPRESSION_USE_IMPORT_EXPORT -DAWS_CRT_CPP_USE_IMPORT_EXPORT -DAWS_EVENT_STREAM_USE_IMPORT_EXPORT -DAWS_HTTP_USE_IMPORT_EXPORT -DAWS_IO_USE_IMPORT_EXPORT -DAWS_MQTT_USE_IMPORT_EXPORT -DAWS_MQTT_WITH_WEBSOCKETS -DAWS_S3_USE_IMPORT_EXPORT -DAWS_SDKUTILS_USE_IMPORT_EXPORT -DAWS_SDK_VERSION_MAJOR=1 -DAWS_SDK_VERSION_MINOR=10 -DAWS_SDK_VERSION_PATCH=13 -DAWS_USE_IO_COMPLETION_PORTS -DBOOST_ALL_DYN_LINK -DBOOST_ALL_NO_LIB -DPROTOBUF_USE_DLLS -DURI_STATIC_BUILD -DUSE_IMPORT_EXPORT -DUSE_IMPORT_EXPORT=1 -DUSE_WINDOWS_DLL_SEMANTICS -D_CRT_SECURE_NO_WARNINGS -D_ENABLE_EXTENDED_ALIGNED_STORAGE -Darrow_shared_EXPORTS -IC:\projects\arrow\cpp\build\src -IC:\projects\arrow\cpp\src -IC:\projects\arrow\cpp\src\generated -external:IC:\projects\arrow\cpp\thirdparty\flatbuffers\include -external:IC:\projects\arrow\cpp\thirdparty\hadoop\include -external:IC:\Miniconda38-x64\envs\arrow\Library\include -external:IC:\projects\arrow\cpp\build\mimalloc_ep\src\mimalloc_ep\include\mimalloc-2.0 -external:W0 /DWIN32 /D_WINDOWS /GR /EHsc /D_SILENCE_TR1_NAMESPACE_DEPRECATION_WARNING  /EHsc /wd5105 /bigobj /utf-8 /W3 /wd4800 /wd4996 /wd4065  /WX /MP /MD /Od /UNDEBUG -std:c++17 -MD /showIncludes /Fosrc\arrow\CMakeFiles\arrow_shared.dir\Unity\unity_12_cxx.cxx.obj /Fdsrc\arrow\CMakeFiles\arrow_shared.dir\ /FS -c C:\projects\arrow\cpp\build\src\arrow\CMakeFiles\arrow_shared.dir\Unity\unity_12_cxx.cxx
C:\projects\arrow\cpp\src\arrow/vendored/fast_float/fast_float.h(30): error C2988: unrecognizable template declaration/definition
C:\projects\arrow\cpp\src\arrow/vendored/fast_float/fast_float.h(30): error C2143: syntax error: missing ';' before '<'
C:\projects\arrow\cpp\src\arrow/vendored/fast_float/fast_float.h(30): error C2059: syntax error: '<'
C:\projects\arrow\cpp\src\arrow/vendored/fast_float/fast_float.h(31): error C2653: 'chars_format': is not a class or namespace name
C:\projects\arrow\cpp\src\arrow/vendored/fast_float/fast_float.h(38): error C2988: unrecognizable template declaration/definition
C:\projects\arrow\cpp\src\arrow/vendored/fast_float/fast_float.h(38): error C2143: syntax error: missing ';' before '<'
C:\projects\arrow\cpp\src\arrow/vendored/fast_float/fast_float.h(38): error C2059: syntax error: '<'
C:\projects\arrow\cpp\src\arrow\vendored\fast_float\ascii_number.h(266): error C2061: syntax error: identifier 'parse_options_t'
...

Comment on lines 40 to 41
sed -i.bak -E -e "s/v[0-9.]+/v${version}/g" *.h
sed -i.bak -E \
gsed -i.bak -E -e "s/v[0-9.]+/v${version}/g" *.h
gsed -i.bak -E \
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we need this?
If we use gsed, it works only on macOS (and *BSD).

@github-actions github-actions bot added awaiting changes Awaiting changes and removed awaiting review Awaiting review labels Jul 2, 2023
@pitrou pitrou changed the title GH-36433: [C++] updated fast_float version to 5.2.0 GH-36433: [C++] Update fast_float version to 5.2.0 Jul 4, 2023
@xxlaykxx xxlaykxx changed the title GH-36433: [C++] Update fast_float version to 5.2.0 GH-36433: [C++] Update fast_float version Jul 4, 2023
@github-actions github-actions bot added Component: Documentation awaiting change review Awaiting change review and removed awaiting changes Awaiting changes labels Jul 4, 2023
@xxlaykxx xxlaykxx requested a review from kou July 4, 2023 15:41
@@ -20,7 +20,7 @@
# fast_float

The files in this directory are vendored from fast_float
git tag `v3.8.1`.
git tag `v3.10.1`.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you really want to use 3.10.1?
It seems that the latest version is 5.2.0: https://github.com/fastfloat/fast_float/releases

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

after 3.10.1 they started using c++ 20 and it cause a lot of build errors. In reality - we just need in parse_number.h

#ifdef FASTFLOAT_ALLOWS_LEADING_PLUS // disabled by default
  if (*first == UC('+')) {
      ++first;
  }

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK. Could you describe it in descriptions of the PR and the associated issue?

@github-actions github-actions bot added awaiting changes Awaiting changes and removed awaiting change review Awaiting change review labels Jul 5, 2023
@xxlaykxx xxlaykxx requested a review from kou July 5, 2023 11:28
@kou kou changed the title GH-36433: [C++] Update fast_float version GH-36433: [C++] Update fast_float version to 3.10.1 Jul 6, 2023
@kou
Copy link
Member

kou commented Jul 6, 2023

It seems that we need to define FASTFLOAT_ALLOWS_LEADING_PLUS=1 explicitly to support +Infinity.
Do you want to do it in this pull request or in a follow-up pull request?

@xxlaykxx
Copy link
Contributor Author

xxlaykxx commented Jul 6, 2023

@kou i'm not sure that everyone need this - for my side, we can just build it with -DFASTFLOAT_ALLOWS_LEADING_PLUS option for enabling this functionality.

@kou
Copy link
Member

kou commented Jul 6, 2023

I'm not familiar with +Infinity needs but it seems that +Infinity is useful for all cases. So I think that it's better that we always set FASTFLOAT_ALLOWS_LEADING_PLUS=1.

Could you share your use-case?
Could you also share downsides when we always set FASTFLOAT_ALLOWS_LEADING_PLUS=1?

@github-actions github-actions bot added awaiting change review Awaiting change review and removed awaiting changes Awaiting changes labels Jul 7, 2023
@xxlaykxx
Copy link
Contributor Author

xxlaykxx commented Jul 7, 2023

not sure that downsides exist with using FASTFLOAT_ALLOWS_LEADING_PLUS 1.

My user case - in dremio some customer want to parse infinity value with + sign when they use gandiva impl of cast varchar to double/float function(same logic exist in Java implementation for cast function). So we want to add this to arrow side too

Copy link
Member

@kou kou left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK.
Let's enable +Infinity unconditionally.

@@ -1,5 +1,6 @@
#ifndef FASTFLOAT_PARSE_NUMBER_H
#define FASTFLOAT_PARSE_NUMBER_H
#define FASTFLOAT_ALLOWS_LEADING_PLUS 1
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you define this in cpp/src/arrow/util/value_parsing.cc instead of here?
If we define this here, this change will be discarded when we update fast_float next time.
And could you also add a Gandiva test to check +Infinity is accepted or not?

@github-actions github-actions bot added awaiting changes Awaiting changes and removed awaiting change review Awaiting change review labels Jul 9, 2023
@xxlaykxx xxlaykxx requested a review from kou July 14, 2023 13:23
@@ -14,6 +14,8 @@
// KIND, either express or implied. See the License for the
// specific language governing permissions and limitations
// under the License.
#ifndef FASTFLOAT_ALLOWS_LEADING_PLUS
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we need this ifndef? What situation are you thinking? I think that this is needless...

@github-actions github-actions bot added awaiting changes Awaiting changes and removed awaiting change review Awaiting change review labels Jul 16, 2023
@github-actions github-actions bot added awaiting change review Awaiting change review and removed awaiting changes Awaiting changes labels Jul 17, 2023
@xxlaykxx xxlaykxx requested a review from kou July 17, 2023 11:09
@github-actions github-actions bot added awaiting changes Awaiting changes and removed awaiting change review Awaiting change review labels Jul 18, 2023
Copy link
Member

@kou kou left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1

I'll merge this after the tiny style improvement is applied.

@github-actions github-actions bot added awaiting merge Awaiting merge and removed awaiting changes Awaiting changes labels Jul 18, 2023
@xxlaykxx
Copy link
Contributor Author

@kou style improvement was merged. Thanks

@kou kou merged commit 3f0b620 into apache:main Jul 19, 2023
@kou kou removed the awaiting merge Awaiting merge label Jul 19, 2023
@kou
Copy link
Member

kou commented Jul 19, 2023

Thanks.
I've merged this.

chelseajonesr pushed a commit to chelseajonesr/arrow that referenced this pull request Jul 20, 2023
### Rationale for this change

Need this for parsing Infinity values with + sign.

### What changes are included in this PR?

updated version of fast_float to version 3.10.1 (used this version because in higher versions c++ 20 started using that cause a lot of build errors)

### Are these changes tested?
 
in scope of fast_float.

### Are there any user-facing changes?
no

* Closes: apache#36433

Lead-authored-by: Ivan Chesnov <[email protected]>
Co-authored-by: Ivan Chesnov <[email protected]>
Co-authored-by: Sutou Kouhei <[email protected]>
Signed-off-by: Sutou Kouhei <[email protected]>
xxlaykxx added a commit to dremio/arrow that referenced this pull request Jul 21, 2023
…) (#34)

### Rationale for this change

Need this for parsing Infinity values with + sign.

### What changes are included in this PR?

updated version of fast_float to version 3.10.1 (used this version because in higher versions c++ 20 started using that cause a lot of build errors)

### Are these changes tested?
 
in scope of fast_float.

### Are there any user-facing changes?
no

* Closes: apache#36433

Lead-authored-by: Ivan Chesnov <[email protected]>

Signed-off-by: Sutou Kouhei <[email protected]>
Co-authored-by: Sutou Kouhei <[email protected]>
xxlaykxx added a commit to dremio/arrow that referenced this pull request Jul 24, 2023
…) (#35)

### Rationale for this change

Need this for parsing Infinity values with + sign.

### What changes are included in this PR?

updated version of fast_float to version 3.10.1 (used this version because in higher versions c++ 20 started using that cause a lot of build errors)

### Are these changes tested?
 
in scope of fast_float.

### Are there any user-facing changes?
no

* Closes: apache#36433

Lead-authored-by: Ivan Chesnov <[email protected]>

Signed-off-by: Sutou Kouhei <[email protected]>
Co-authored-by: Sutou Kouhei <[email protected]>
@conbench-apache-arrow
Copy link

After merging your PR, Conbench analyzed the 6 benchmarking runs that have been run so far on merge-commit 3f0b620.

There were no benchmark performance regressions. 🎉

The full Conbench report has more details. It also includes information about possible false positives for unstable benchmarks that are known to sometimes produce them.

lriggs pushed a commit to dremio/arrow that referenced this pull request Jul 28, 2023
…) (#35)

### Rationale for this change

Need this for parsing Infinity values with + sign.

### What changes are included in this PR?

updated version of fast_float to version 3.10.1 (used this version because in higher versions c++ 20 started using that cause a lot of build errors)

### Are these changes tested?
 
in scope of fast_float.

### Are there any user-facing changes?
no

* Closes: apache#36433

Lead-authored-by: Ivan Chesnov <[email protected]>

Signed-off-by: Sutou Kouhei <[email protected]>
Co-authored-by: Sutou Kouhei <[email protected]>
R-JunmingChen pushed a commit to R-JunmingChen/arrow that referenced this pull request Aug 20, 2023
### Rationale for this change

Need this for parsing Infinity values with + sign.

### What changes are included in this PR?

updated version of fast_float to version 3.10.1 (used this version because in higher versions c++ 20 started using that cause a lot of build errors)

### Are these changes tested?
 
in scope of fast_float.

### Are there any user-facing changes?
no

* Closes: apache#36433

Lead-authored-by: Ivan Chesnov <[email protected]>
Co-authored-by: Ivan Chesnov <[email protected]>
Co-authored-by: Sutou Kouhei <[email protected]>
Signed-off-by: Sutou Kouhei <[email protected]>
loicalleyne pushed a commit to loicalleyne/arrow that referenced this pull request Nov 13, 2023
### Rationale for this change

Need this for parsing Infinity values with + sign.

### What changes are included in this PR?

updated version of fast_float to version 3.10.1 (used this version because in higher versions c++ 20 started using that cause a lot of build errors)

### Are these changes tested?
 
in scope of fast_float.

### Are there any user-facing changes?
no

* Closes: apache#36433

Lead-authored-by: Ivan Chesnov <[email protected]>
Co-authored-by: Ivan Chesnov <[email protected]>
Co-authored-by: Sutou Kouhei <[email protected]>
Signed-off-by: Sutou Kouhei <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[C++] Update fast_float version for parsing Infinity values with + sign
2 participants