clickhouse-activerecord icon indicating copy to clipboard operation
clickhouse-activerecord copied to clipboard

Extended Arel functions from Clickhouse, cluster configuration

Open astudnev opened this issue 5 years ago • 1 comments

  1. Added a number of clickhouse functions from Arel, now it is possible to use Arel expressions: Mode.arel_table.project(Arel.star.countIf(Arel.sql('1=2'))).to_sql

Supported the following aggregated functions:

'any','anyHeavy','sumWithOverflow','anyLast', 'groupBitAnd','groupBitOr','groupBitXor', 'groupBitmap','groupBitmapAnd','groupBitmapOr','groupBitmapXor','skewPop','skewSamp','kurtPop','kurtSamp', 'unique','uniqueExact','median','varSamp','varPop', 'stddevSamp','stddevPop'

And conditional functions ( with 'If' suffices)

Added USING statement, possible to use as group('a').using('id')

Added to(type) functions, such as to('Float64')

Added cluster configuration, use

urls: [http://host:port,http://host2:port2]

Added use_session: true / false configuration to manage session support

astudnev avatar Feb 22 '20 22:02 astudnev

Not working methods maxMerge, minMerge and etc. for MaterializedView table with engine AggregatingMergeTree. See documentations https://clickhouse.tech/docs/en/operations/table_engines/aggregatingmergetree/#example-of-an-aggregated-materialized-view

We need to work: Event.maximum(:created_at) for view and similar request for table Action.maximum(:created_at)

PNixx avatar Apr 01 '20 09:04 PNixx