Class CopyStatement (0.5.1)

public class CopyStatement extends IntermediateStatement

Inheritance

java.lang.Object > IntermediateStatement > CopyStatement

Constructors

CopyStatement(ConnectionHandler connectionHandler, OptionsMetadata options, AbstractStatementParser.ParsedStatement parsedStatement, Statement originalStatement)

public CopyStatement(ConnectionHandler connectionHandler, OptionsMetadata options, AbstractStatementParser.ParsedStatement parsedStatement, Statement originalStatement)
Parameters
NameDescription
connectionHandlerConnectionHandler
optionsOptionsMetadata
parsedStatementParsedStatement
originalStatementcom.google.cloud.spanner.Statement

Methods

close()

public void close()

Cleanly close the statement. Does nothing if the statement has not been executed or has no result.

Overrides Exceptions
TypeDescription
Exception

execute()

public void execute()

getCopyColumnNames()

public List<String> getCopyColumnNames()
Returns
TypeDescription
List<String>

List of column names specified in COPY statement, if provided.

getDelimiterChar()

public char getDelimiterChar()
Returns
TypeDescription
char

Delimiter character specified in COPY statement, if provided.

getEscapeChar()

public char getEscapeChar()
Returns
TypeDescription
char

Escape character specified in COPY statement, if provided.

getException()

public Exception getException()
Returns
TypeDescription
Exception
Overrides

getFormatCode()

public int getFormatCode()
Returns
TypeDescription
int

0 for text/csv formatting and 1 for binary

getFormatType()

public String getFormatType()
Returns
TypeDescription
String

Format type specified in COPY statement, if provided.

getMutationWriter()

public MutationWriter getMutationWriter()
Returns
TypeDescription
MutationWriter

getNullString()

public String getNullString()
Returns
TypeDescription
String

Null string specified in COPY statement, if provided.

getParserFormat()

public CSVFormat getParserFormat()
Returns
TypeDescription
org.apache.commons.csv.CSVFormat

getQuoteChar()

public char getQuoteChar()
Returns
TypeDescription
char

Quote character specified in COPY statement, if provided.

getStatementType()

public AbstractStatementParser.StatementType getStatementType()
Returns
TypeDescription
StatementType
Overrides

getTableColumns()

public Map<String,TypeCode> getTableColumns()
Returns
TypeDescription
Map<String,com.google.spanner.v1.TypeCode>

Mapping of table column names to column type.

getTableName()

public String getTableName()
Returns
TypeDescription
String

getUpdateCount()

public long getUpdateCount()
Returns
TypeDescription
long
Overrides

handleExecutionException(SpannerException exception)

public void handleExecutionException(SpannerException exception)

Clean up and save metadata when an exception occurs.

Parameter
NameDescription
exceptioncom.google.cloud.spanner.SpannerException
Overrides

hasHeader()

public boolean hasHeader()
Returns
TypeDescription
boolean

True if copy data contains a header, false otherwise.

setParserFormat(CopyTreeParser.CopyOptions options)

public void setParserFormat(CopyTreeParser.CopyOptions options)

CSVFormat for parsing copy data based on COPY statement options specified.

Parameter
NameDescription
optionsCopyTreeParser.CopyOptions