cube-js/cube · error

not used

Error message

not used

What it means

The partition method on this store implementation is explicitly unimplemented: it panics with 'not used' because partition creation for this backend goes through build_index_chunks / repartition paths instead of the trait's partition(_wal_id) entry point. Hitting it means an internal code path called a method that should never be invoked.

Source

Thrown at rust/cubestore/cubestore/src/store/mod.rs:440

#[async_trait]
impl ChunkDataStore for ChunkStore {
    async fn partition_data(
        &self,
        table_id: u64,
        rows: Vec<ArrayRef>,
        columns: &[Column],
        in_memory: bool,
    ) -> Result<Vec<ChunkUploadJob>, CubeError> {
        let indexes = self
            .meta_store
            .get_table_indexes_out_of_queue(table_id)
            .await?;
        self.build_index_chunks(table_id, &indexes, rows.into(), columns, in_memory)
            .await
    }

    async fn partition(&self, _wal_id: u64) -> Result<(), CubeError> {
        panic!("not used");
    }

    async fn repartition(&self, partition_id: u64) -> Result<(), CubeError> {
        let (partition, index, table, _) = self
            .meta_store
            .get_partition_for_compaction(partition_id)
            .await?;
        if partition.get_row().is_active() {
            return Err(CubeError::internal(format!(
                "Tried to repartition active partition: {:?}",
                partition
            )));
        }

        let chunks = self
            .meta_store
            .get_chunks_by_partition(partition_id, false)
            .await?

View on GitHub (pinned to 7d981676b3)

Solutions

  1. Use the supported ingestion/compaction APIs (build_index_chunks / repartition) rather than partition
  2. Upgrade to an official CubeStore build where WAL handling does not call this method
  3. File a bug with the call stack if reached during normal operation
Defensive patterns

Strategy: fallback

Validate before calling

// avoid custom paths that call partition() directly; prefer supported ingestion
if (typeof store.partition === 'function' && isOfficialBuild) use supportedIngestionPath(); else useRepartitionPath();

Try / catch

// in custom Rust integrations, intercept before calling the trait method
async fn safe_partition(store: &dyn PartitionTraits, wal_id: u64) -> Result<(), CubeError> {
    Err(CubeError::internal("partition() unsupported for this store; use repartition/build_index_chunks"))
}

Prevention

When it happens

Trigger: Calling partition(_wal_id) directly or an internal flow (e.g. WAL replay invoking partition) that the implementation does not support — any code path expecting this store trait impl to partition raw WAL data.

Common situations: Custom code or a modified CubeStore build invoking the PartitionTraits partition method directly; a bug where WAL replay routes work to the unimplemented method.

Related errors


AI-assisted analysis of cube-js/cube@7d981676b3 (2026-09-02). Data as JSON: /api/errors/a3b6115c9a1b581a. Report an issue: GitHub.