Class DefaultCortexConnectionReader.CortexReadParameters
- java.lang.Object
-
- com.c12e.cortex.profiles.module.connection.DefaultCortexConnectionReader.CortexReadParameters
-
- All Implemented Interfaces:
CortexConnectionReader
,CortexReader<org.apache.spark.sql.Dataset<org.apache.spark.sql.Row>,CortexConnectionReader>
- Enclosing class:
- DefaultCortexConnectionReader
public class DefaultCortexConnectionReader.CortexReadParameters extends java.lang.Object implements CortexConnectionReader
-
-
Field Summary
Fields Modifier and Type Field Description protected com.c12e.cortex.phoenix.Connection
connection
protected java.lang.String
connectionName
protected java.lang.String
project
protected org.apache.spark.sql.types.StructType
schema
protected SparkOptionsHandler
sparkOptionsHandler
-
Constructor Summary
Constructors Constructor Description CortexReadParameters()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description org.apache.spark.sql.Dataset<org.apache.spark.sql.Row>
load()
Completes building and begins read processio.delta.tables.DeltaTable
loadDeltaTable()
Loads the data as a delta table ifContentType
is deltaCortexConnectionReader
option(java.lang.String key, java.lang.String value)
Overwrites value at keyCortexConnectionReader
options(java.util.Map<java.lang.String,java.lang.String> readOptions)
Merges new options with current optionsCortexConnectionReader
project(java.lang.String project)
Sets the projectCortexConnectionReader
resourceName(java.lang.String resourceName)
Sets the resource to write toCortexConnectionReader
schema(org.apache.spark.sql.types.StructType schema)
Override dataset schema when ableCortexConnectionReader
withConnection(com.c12e.cortex.phoenix.Connection connection)
Override connection write
-
-
-
Field Detail
-
project
protected java.lang.String project
-
connectionName
protected java.lang.String connectionName
-
sparkOptionsHandler
protected SparkOptionsHandler sparkOptionsHandler
-
connection
protected com.c12e.cortex.phoenix.Connection connection
-
schema
protected org.apache.spark.sql.types.StructType schema
-
-
Method Detail
-
resourceName
public CortexConnectionReader resourceName(java.lang.String resourceName)
Description copied from interface:CortexReader
Sets the resource to write to- Specified by:
resourceName
in interfaceCortexReader<org.apache.spark.sql.Dataset<org.apache.spark.sql.Row>,CortexConnectionReader>
- Returns:
- this instance
-
options
public CortexConnectionReader options(java.util.Map<java.lang.String,java.lang.String> readOptions)
Description copied from interface:CortexReader
Merges new options with current options- Specified by:
options
in interfaceCortexReader<org.apache.spark.sql.Dataset<org.apache.spark.sql.Row>,CortexConnectionReader>
- Returns:
- this instance
-
option
public CortexConnectionReader option(java.lang.String key, java.lang.String value)
Description copied from interface:CortexReader
Overwrites value at key- Specified by:
option
in interfaceCortexReader<org.apache.spark.sql.Dataset<org.apache.spark.sql.Row>,CortexConnectionReader>
- Returns:
- this instance
-
withConnection
public CortexConnectionReader withConnection(com.c12e.cortex.phoenix.Connection connection)
Description copied from interface:CortexConnectionReader
Override connection write- Specified by:
withConnection
in interfaceCortexConnectionReader
- Returns:
- this instance
-
project
public CortexConnectionReader project(java.lang.String project)
Description copied from interface:CortexReader
Sets the project- Specified by:
project
in interfaceCortexReader<org.apache.spark.sql.Dataset<org.apache.spark.sql.Row>,CortexConnectionReader>
- Returns:
- this instance
-
load
public org.apache.spark.sql.Dataset<org.apache.spark.sql.Row> load()
Description copied from interface:CortexReader
Completes building and begins read process- Specified by:
load
in interfaceCortexReader<org.apache.spark.sql.Dataset<org.apache.spark.sql.Row>,CortexConnectionReader>
-
schema
public CortexConnectionReader schema(org.apache.spark.sql.types.StructType schema)
Description copied from interface:CortexConnectionReader
Override dataset schema when able- Specified by:
schema
in interfaceCortexConnectionReader
- Returns:
- this instance
-
loadDeltaTable
public io.delta.tables.DeltaTable loadDeltaTable()
Description copied from interface:CortexConnectionReader
Loads the data as a delta table ifContentType
is delta- Specified by:
loadDeltaTable
in interfaceCortexConnectionReader
- Returns:
- the delta table
-
-