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

JSONEachRow can not parse +Inf to float64 #1839

Closed
korservick opened this issue Jan 30, 2018 · 4 comments · Fixed by #10272
Closed

JSONEachRow can not parse +Inf to float64 #1839

korservick opened this issue Jan 30, 2018 · 4 comments · Fixed by #10272
Assignees

Comments

@korservick
Copy link

CH version: 1.1.54342
log:
2018.01.30 17:12:40.931768 [ 30 ] executeQuery: Code: 72, e.displayText() = DB::Exception: Cannot read floating point value: (at row 121867)
, e.what() = DB::Exception (from 172.21.0.3:49692) (in query: select count() from kafka_json), Stack trace:

  1. /usr/bin/clickhouse-server(StackTrace::StackTrace()+0x15) [0x73178b5]
  2. /usr/bin/clickhouse-server(DB::Exception::Exception(std::__cxx11::basic_string<char, std::char_traits, std::allocator > const&, int)+0x1e) [0x19ca19e]
  3. /usr/bin/clickhouse-server(void DB::readFloatTextFast(double&, DB::ReadBuffer&)+0x10e4) [0x7347d24]
  4. /usr/bin/clickhouse-server(DB::DataTypeNumberBase::deserializeTextJSON(DB::IColumn&, DB::ReadBuffer&) const+0x4a) [0x6036c8a]
  5. /usr/bin/clickhouse-server(DB::JSONEachRowRowInputStream::read(std::vector<COWPtrDB::IColumn::mutable_ptrDB::IColumn, std::allocator<COWPtrDB::IColumn::mutable_ptrDB::IColumn > >&)+0x510) [0x69a5540]
  6. /usr/bin/clickhouse-server(DB::BlockInputStreamFromRowInputStream::readImpl()+0x97) [0x6b780e7]
  7. /usr/bin/clickhouse-server(DB::IProfilingBlockInputStream::read()+0x26f) [0x5fe84cf]
  8. /usr/bin/clickhouse-server(DB::KafkaBlockInputStream::readImpl()+0x8b) [0x6b3713b]
  9. /usr/bin/clickhouse-server(DB::IProfilingBlockInputStream::read()+0x26f) [0x5fe84cf]
  10. /usr/bin/clickhouse-server(DB::ExpressionBlockInputStream::readImpl()+0x2c) [0x698f40c]
  11. /usr/bin/clickhouse-server(DB::IProfilingBlockInputStream::read()+0x26f) [0x5fe84cf]
  12. /usr/bin/clickhouse-server(DB::ConcatBlockInputStream::readImpl()+0xbb) [0x66d4f0b]
  13. /usr/bin/clickhouse-server(DB::IProfilingBlockInputStream::read()+0x26f) [0x5fe84cf]
  14. /usr/bin/clickhouse-server(DB::Aggregator::execute(std::shared_ptrDB::IBlockInputStream const&, DB::AggregatedDataVariants&)+0x269) [0x6a5ed99]
  15. /usr/bin/clickhouse-server(DB::AggregatingBlockInputStream::readImpl()+0x5e7) [0x69553b7]
  16. /usr/bin/clickhouse-server(DB::IProfilingBlockInputStream::read()+0x26f) [0x5fe84cf]
  17. /usr/bin/clickhouse-server(DB::ExpressionBlockInputStream::readImpl()+0x2c) [0x698f40c]
  18. /usr/bin/clickhouse-server(DB::IProfilingBlockInputStream::read()+0x26f) [0x5fe84cf]
  19. /usr/bin/clickhouse-server(DB::ExpressionBlockInputStream::readImpl()+0x2c) [0x698f40c]
  20. /usr/bin/clickhouse-server(DB::IProfilingBlockInputStream::read()+0x26f) [0x5fe84cf]
  21. /usr/bin/clickhouse-server(DB::AsynchronousBlockInputStream::calculate(MemoryTracker*)+0x54) [0x19dc544]
  22. /usr/bin/clickhouse-server(ThreadPool::worker()+0x16d) [0x7361b9d]
  23. /usr/bin/clickhouse-server() [0x76fcfae]
  24. /lib/x86_64-linux-gnu/libpthread.so.0(+0x76b9) [0x7f6c87b3c6b9]
  25. /lib/x86_64-linux-gnu/libc.so.6(clone+0x6c) [0x7f6c875693dc]

2018.01.30 17:12:40.974737 [ 30 ] StorageKafka (kafka_json): KafkaBlockInputStream did not finish successfully, unsubscribing from assignments and rejoining

@filimonov
Copy link
Contributor

Just inf/Inf (without plus sign) is supported, but may be signed +Inf can also be supported.

testcase:

CREATE TABLE float_inf_problem ( x Float64 ) ENGINE = Memory;
insert into float_inf_problem format JSONEachRow {"x":"+inf"};

# those - work:
insert into float_inf_problem format JSONEachRow {"x":"-inf"};
insert into float_inf_problem format JSONEachRow {"x":"inf"};

insert into float_inf_problem format Values (+inf);
insert into float_inf_problem format Values (+Inf);

@alexey-milovidov
Copy link
Member

JSON in its specification has no support for inf, nan.
But we have some support, and I think we should also add support for +inf.

@alexey-milovidov alexey-milovidov self-assigned this Feb 7, 2018
@stale stale bot added the stale label Oct 20, 2019
@ClickHouse ClickHouse deleted a comment from stale bot Apr 15, 2020
@alexey-milovidov
Copy link
Member

alexey-milovidov commented Apr 15, 2020

+inf is not supported in all text formats including TSV, CSV, JSONEachRow.

@korservick
Copy link
Author

2 years ago... :) Just remember that I catch this +inf from Node.js code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants