/**
* explicitly defines all attributes.
*/
@Test
public void attributes() {
ModelDeclaration model = analyze(new String[] {
"@directio.hive.parquet(",
" table_name = 'attributes_test',",
" field_mapping = 'name',",
" on_missing_source = 'ignore',",
" on_missing_target = 'fail',",
" on_incompatible_type = 'logging',",
" format_version = 'v2',",
" compression = 'uncompressed',",
" block_size = 100000000,",
" data_page_size = 1000001,",
" dictionary_page_size = 1000002,",
" enable_dictionary = FALSE,",
" enable_validation = TRUE,",
")",
"model = { simple : INT; };"
}).findModelDeclaration("model");
assertThat(model.getTrait(HiveDataModelTrait.class), is(notNullValue()));
ParquetFileTrait trait = model.getTrait(ParquetFileTrait.class);
assertThat(trait, is(notNullValue()));
assertThat(trait.getOriginalAst(), is(notNullValue()));
assertThat(trait.getTableName(), is("attributes_test"));
assertThat(trait.configuration().getFieldMappingStrategy(), is(FieldMappingStrategy.NAME));
assertThat(trait.configuration().getOnMissingSource(), is(ExceptionHandlingStrategy.IGNORE));