Java API for Register File
Applies to: Kyvos Enterprise Kyvos Cloud (SaaS on AWS) Kyvos AWS Marketplace
Kyvos Azure Marketplace  Kyvos GCP Marketplace Kyvos Single Node Installation (Kyvos SNI)
Overview
Create a RegisteredFile object and set the HDFS folder path to where the CSV file is stored.
Create a RegisteredFile object using the HCatalog data source.
Iterate the columns in RegisteredFile to format (formatting may include changing the caption, input format, data type, and so on).
Add the RegisteredFile object in the repository.
Retrieve existing RegisteredFile object from repository.
Update CSV properties of existing RegisteredFile object:
path of CSV file
line separator character
field separator character
escape character
enclosed by character
skip top lines
encoding style
if file contains header
if need to ignore empty rows
to include file name as a column
Refresh RegisteredFile columns.
Update RegisteredFile object in the repository.
Data profile for File with ONCE option
Data profile for File with NOW option
Example
Create the RegisteredFile object (This API fetches the Registered File object and sets column details in the Fetch step)
/** * method to create Registered File object in Repository Manager. * @param folderPath: Full path of the datasource file. * @param userInfo: Object of type UserInfo containing information about logged in user. * @return RegisteredFile: Object of type RegisteredFile. */ public RegisteredFile registerCSVFile(String folderPath, UserInfo userInfo);
Create the RegisteredFile object using HCatalogSource.
/** * method to create Registered File object in Repository Manager. * @param hcatalog: Object of type HCatalogSource. * @param userInfo: Object of type UserInfo containing information about logged in user. * @return RegisteredFile: Object of type RegisteredFile. */ public RegisteredFile registerHCatalogDataSource(HCatalogSource hcatalog, UserInfo userInfo); /** * method to create Registered File object using HCatalog database and table name. * @param dbName: Name of the hCatalog database. * @param tableName: Name of the hCatalog table. * @param userInfo: Object of type UserInfo containing information about logged in user * @return RegisteredFile: Object of type RegisteredFile. * @throws ReportObjectException. */ public RegisteredFile registerHCatalogDataSource(String dbName, String tableName, UserInfo userInfo);
Fetch columns from the RegisteredFile object.
/* * @return ArrayList<FetchColumn>: ArrayList of FetchColumn objects. */ public ArrayList<FetchColumn> getColumnDetails(); /* Â * On iterating this ArrayList, user will get a FetchColumn object for each column. */ public void setName(String columnName); public void setDataType(String dataType); public void setFieldFormat(String fieldFormat); public void setColumnDetails(ArrayList <FetchColumn> columnList);
Add the RegisteredFile object to the repository.
Retrieve existing RegisteredFile object from repository.
Update CSV properties of existing RegisteredFile object.
Update CSV file path
Update line separator character.
Update field separator character.
Update escape character
Update enclosed by character.
Update skip toplines.
Update encoding style.
Update if file contains header.
Update if need to ignore empty rows
Update to include file name as column.
Refresh RegisteredFile columns upon updating CSV properties.
Update the RegisteredFile object in the repository.
Preview on Register Files.
Data profile for File with ONCE option.
Data profile for File with NOW option.Â
 Constructor to create a blank file containing a fetch step and a filter step linked together.
Set an ID of the registered file.
Get a registered file id. Â Â
 Set a folder id of the registered file.  Â
Set a folder name of the registered file.
Set a connection name in the registered file to connect with the data source.
 Set input type in a file.
Add a filter in the registered file.Â
Add or update a user parameter.Â
Remove a user parameter from the file.Â
Set column metadata into the file.
Get the input type of the file.
Get FilterStep from the registered file.
Set and get partition column details on the registered File.
Get incremental identifier column name.
Set partition table name.
Set the partition column's metadata mode.Â
Set the partition column's minimum value.
Set the partition column's maximum value.
Set the partition column's record count.
Set the number of partitions.
Set incremental identifier column in the registered file.
Sample Code
Copyright Kyvos, Inc. All rights reserved.