DBIx-Class-Snowflake
view release on metacpan or search on metacpan
lib/DBIx/Class/Snowflake/Manual.pod view on Meta::CPAN
'dimCity.name' => 1,
'dimCategory.name' => 1
}
}
For the filters hash the values should be the value you are filtering on, for
the metrics hash the value is ignored, it is only formatted like that for
consistency.
The easiest way to use generate_report is in conjunction with attributes().
The names provided by attributes are the same names generate_report expects.
The resultset returned will have columns for each of the metrics requested
regardless of where they are actually located in the schema, so for exampe.
$rs = $schema->resultset('FactSales')->generate_report($data_above)
$rs will have a column dimBook.EAN_code, but it won't have an accessor
to access it do this:
$rs->get_column('dimBook.EAN_code');
Then you can treat it like a normal column by getting it's values, max, etc.
=head1 DIAGNOSTICS
B<Can't locate object method "generate_report" via package "MySchema::FactB" at ...> - You forgot to load the Snowflake::Fact component for fact table FactB.
B<Can't locate object method "attributes" via package "DBIx::Class::ResultSet" at ...> - You forgot to set the resultset_class to DBIx::Class::Snowflake::ResultSet::Dimension or DBIx::Class::Snowflake::ResultSet::Fact for one of the facts or dimensio...
B<Can't locate object method "_resolve_metrics" via package "MySchema::DimExample" at ...> - You forgot to load the Snowflake::Dimension component for the dimension table DimExample.
B<Unable to resolve dimension 'some_attr', does not exist in snowflake. at...> - You've passed in an attribute inside the filters hash into generate_report that doesn't exist, after it searched all of your dimensions it gave up.
B<Unable to resolve dimension 'some_attr', does not exist in snowflake. at...> - You've passed in an attribute inside your B<metric> hash into generate_report that doesn't exist, after it searched all of your dimensions it gave up.
B<Unable to determine what columns to ignore, I don't know what to do with a 'something'.> - You've passed in something to
ignore_columns that isn't an acceptable value. Or, possibly, you passed in a
coderef that generated a value that wasn't acceptable.
=head1 DEPENDENCIES
This Module requires DBIx::Class. This module should probably be used in only
star and snowflake schemas, but if you find another use for this then please
let me know via email.
=head1 TODO
=over
=item *
Modify generate_report so it generates a smaller set of JOINs
=item *
Modify the filter conversion code to be more efficient.
=back
=head1 BUGS AND LIMITATIONS
The B<generate_report> function could be made to be more efficient.
Please report other problems to Matt Follett<cpan(AT_GOES_HERE)mfollett.com>
Patches are welcome.
=cut
( run in 1.803 second using v1.01-cache-2.11-cpan-39bf76dae61 )