Sha256: 45c072104c013bd1c82160ee86b928a9e186dc4a92eb0d202ec6f0036474781f

Contents?: true

Size: 768 Bytes

Versions: 4

Compression:

Stored size: 768 Bytes

Contents

# encoding: utf-8

describe "CREATE AGGREGATE" do

  let(:aggregate) do
    QueryBuilder::CQL.keyspace(:wildlife).aggregate(:numAverage)
  end

  let(:statement) { aggregate.create }

  it_behaves_like :query_builder do
    subject   { statement }
    let(:cql) { "CREATE AGGREGATE wildlife.numAverage ();" }
  end

  it_behaves_like :query_builder do
    subject do
      statement
        .or_replace
        .if_not_exists
        .argument(:input, :int)
        .sfunc(:avgState)
        .stype(:bigint)
        .finalfunc(:avgFinal)
        .initcond(0, 0)
    end

    let(:cql) { "CREATE OR REPLACE AGGREGATE IF NOT EXISTS wildlife.numAverage (input int) SFUNC avgState STYPE bigint FINALFUNC avgFinal INITCOND (0, 0);" }
  end

end # describe CREATE AGGREGATE

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
query_builder-0.0.4 spec/integration/create_aggregate_spec.rb
query_builder-0.0.3 spec/integration/create_aggregate_spec.rb
query_builder-0.0.2 spec/integration/create_aggregate_spec.rb
query_builder-0.0.1 spec/integration/create_aggregate_spec.rb