Table of Contents |
---|
...
For filesets, by default, all files and directories are created with the file system's default umask, and with the group of the parent directory. This can be overridden by dataset properties. For example, this configures read, write and execute for the owner and the group "etl":
Code Block language java PartitionedFileSetProperties.builder() ... .setFilePermissions("770") .setFileGroup("etl") .build();
For tables, additional permissions can be granted as part of the table creation. For example, this allows read and write for the user "joe" and read only for all members of the group "etl":
Code Block language javaTableProperties.builder() ... .setTablePermissions(ImmutableMap.of("joe", "RW", "@etl", "R") .build();
Note that this is also need for PartitionedFileSets, because their partition metadata is stored in an HBase table.
- Explore permissions in Hive must be granted manually outside of CDAP.
...
By default, the Explore table for a dataset is in the enclosing namespace's database and named dataset_<name>
. In CDAP 4.1, you can configure a custom Hive database and table name as follows
languageCode Block java PartitionedFileSetProperties.builder() ... .setExploreDatabaseName("my_database") .setExploreTableName("clicks_gold") .build();
Note that the database name must exist as CDAP will not attempt to create it.
...
- FileSetProperties.setUseExisting(true) (or DATA_USE_EXISTING / "data.use.existing") to reuse an existing location and Hive table. The dataset will assume that it does not own the existing data in that location and Hive table, and therefore, when you delete or truncate the dataset, the data will not be deleted.
- FileSetProperties.setPossessExisting(true) (or DATA_POSSESS_EXISTING / "data.possess.existing") to assume ownership an existing location and Hive table. The dataset will assume that it owns the existing data in that location and Hive table, and therefore, when you delete or truncate the dataset, all data will be deleted, including the previously existing data and Hive partitions.
...
To enable Hive to impersonate other users, set the following in hive-site.xml
...