Skip to content

Instantly share code, notes, and snippets.

@mrzzzrm
Created September 24, 2017 16:05
Show Gist options
  • Save mrzzzrm/1a89f019a3f63ac1a3e543412dd1d4d3 to your computer and use it in GitHub Desktop.
Save mrzzzrm/1a89f019a3f63ac1a3e543412dd1d4d3 to your computer and use it in GitHub Desktop.
auto gt_customer = std::make_shared<opossum::GetTable>("CUSTOMER");
auto validate = std::make_shared<opossum::Validate>(gt_customer);
auto first_filter = std::make_shared<opossum::TableScan>(validate, opossum::ColumnID{5} /* "C_LAST" */,
opossum::ScanType::OpEquals, c_last);
auto second_filter = std::make_shared<opossum::TableScan>(first_filter, opossum::ColumnID{1} /* "C_D_ID" */,
opossum::ScanType::OpEquals, c_d_id);
auto third_filter = std::make_shared<opossum::TableScan>(second_filter, opossum::ColumnID{2} /* "C_W_ID" */,
opossum::ScanType::OpEquals, c_w_id);
auto projection = std::make_shared<opossum::Projection>(
third_filter, opossum::Projection::ColumnExpressions(
{opossum::Expression::create_column(opossum::ColumnID{16} /* "C_BALANCE" */),
opossum::Expression::create_column(opossum::ColumnID{3}) /* "C_FIRST" */,
opossum::Expression::create_column(opossum::ColumnID{4} /* "C_MIDDLE" */),
opossum::Expression::create_column(opossum::ColumnID{0} /* "C_ID" */)}));
auto sort = std::make_shared<opossum::Sort>(projection, opossum::ColumnID{1} /* "C_FIRST" */,
opossum::OrderByMode::Ascending);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment