Comments (5)
Livebook smart cell :)
from ch.
Streaming the results of queries would be great. I think it requires setting the connection mode to active though.
from ch.
Streaming the results of queries would be great. I think it requires setting the connection mode to active though.
There is an undocumented Ch.stream
function that is used in the benchmarks. It doesn't decode the raw data into rows very well yet (right now it only does the decoding if :types
option is provided).
Here's a minimal example:
{:ok, pid} = Ch.start_link()
Ch.run(pid, fn conn ->
conn
|> Ch.stream("select number from system.numbers limit {limit:UInt64}", %{"limit" => 1_000_000}, types: ["UInt64"])
|> Stream.each(fn rows -> IO.puts("at #{Time.utc_now()} got #{length(List.flatten(rows))} rows") end)
|> Stream.run()
end)
at 13:24:49.737616 got 2560 rows
at 13:24:49.742150 got 36864 rows
at 13:24:49.752535 got 50657 rows
at 13:24:49.760068 got 51169 rows
at 13:24:49.765942 got 50688 rows
at 13:24:49.771635 got 51169 rows
at 13:24:49.776692 got 50657 rows
at 13:24:49.782096 got 51169 rows
at 13:24:49.787199 got 50657 rows
at 13:24:49.792197 got 51200 rows
at 13:24:49.797056 got 50657 rows
at 13:24:49.802442 got 51169 rows
at 13:24:49.807619 got 50657 rows
at 13:24:49.812214 got 51200 rows
at 13:24:49.816771 got 50657 rows
at 13:24:49.821738 got 51169 rows
at 13:24:49.826986 got 51169 rows
at 13:24:49.831561 got 50657 rows
at 13:24:49.836822 got 51200 rows
at 13:24:49.841795 got 50657 rows
at 13:24:49.846984 got 44018 rows
And some tests.
from ch.
@hkrutzer yeah, most likely. We'd "just" need to decode types from RowBinaryWithNamesAndTypes
and store them in the accumulator.
from ch.
That's great! Will it support not having to specify types
in the future?
from ch.
Related Issues (15)
- finalise Ch.stream
- Performance degraded for returning high number of rows HOT 4
- Can't cast `SimpleAggregateFunction(groupArrayArray, Array(DateTime('UTC')))` HOT 4
- faster invalid utf8 escaping
- Possible memory leak when driver fails to connect due to failed auth HOT 3
- QUESTION: do you recommend using this package or your fork of clickhousex? HOT 2
- Better error/support message for standard Decimal type usage HOT 4
- raise on UNION with OFFSET / LIMIT
- use RowBinaryWithNamesAndTypes for better error messages
- check how much (if any) slowdown comes from Ecto.Type casting, dumping, loading
- add timezones in query params caveat + non-utc server timezone
- table of contents in readme HOT 1
- mix ecto.ch.schema fails for columns with type `AggregateFunction` HOT 30
- maybe trim newlines in SQL when RowBinary is used HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ch.