File tree Expand file tree Collapse file tree
perspective-server/cpp/perspective/src/cpp Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -585,6 +585,23 @@ const data = {
585585 table . delete ( ) ;
586586 } ) ;
587587
588+ test ( "with split_by schema" , async function ( ) {
589+ const table = await perspective . table ( data ) ;
590+ const view = await table . view ( {
591+ split_by : [ "z" ] ,
592+ group_rollup_mode : "total" ,
593+ } ) ;
594+ const schema = await view . schema ( ) ;
595+ expect ( schema ) . toStrictEqual ( {
596+ w : "float" ,
597+ x : "integer" ,
598+ y : "integer" ,
599+ z : "integer" ,
600+ } ) ;
601+ view . delete ( ) ;
602+ table . delete ( ) ;
603+ } ) ;
604+
588605 test ( "updates after table.update()" , async function ( ) {
589606 const table = await perspective . table ( data ) ;
590607 const view = await table . view ( {
Original file line number Diff line number Diff line change @@ -461,7 +461,7 @@ View<CTX_T>::schema() const {
461461 std::string type_string = dtype_to_str (types[agg_name]);
462462 new_schema[agg_name] = type_string;
463463
464- if ((!m_row_pivots.empty () || m_view_config->is_total_only ()) && !is_column_only ()) {
464+ if ((!m_row_pivots.empty () || m_view_config->is_total_only ()) && ( !is_column_only () || m_view_config-> is_total_only () )) {
465465 new_schema[agg_name] =
466466 _map_aggregate_types (agg_name, new_schema[agg_name]);
467467 }
@@ -540,7 +540,7 @@ View<CTX_T>::expression_schema() const {
540540 const std::string& expression_alias = expr->get_expression_alias ();
541541 new_schema[expression_alias] = dtype_to_str (expr->get_dtype ());
542542
543- if ((!m_row_pivots.empty () || m_view_config->is_total_only ()) && !is_column_only ()) {
543+ if ((!m_row_pivots.empty () || m_view_config->is_total_only ()) && ( !is_column_only () || m_view_config-> is_total_only () )) {
544544 new_schema[expression_alias] = _map_aggregate_types (
545545 expression_alias, new_schema[expression_alias]
546546 );
You can’t perform that action at this time.
0 commit comments