|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.sf.farrago.namespace.flatfile.FlatFileBcpFile
class FlatFileBcpFile
FlatFileBCPFile provides a way to read/write from/to control (bcp) files
Nested Class Summary | |
---|---|
static class |
FlatFileBcpFile.BcpType
|
Field Summary | |
---|---|
(package private) String[] |
colDataLength
|
(package private) String[] |
colDataType
|
(package private) String[] |
colNames
|
(package private) File |
ctrlFile
|
(package private) FileWriter |
ctrlWriter
|
private static Pattern |
DoublePattern
|
private static String |
EmptyLinePattern
|
(package private) String |
fileName
|
private static Pattern |
IntegerPattern
|
private static String |
NEWLINE
|
private static String |
QUOTE
|
private static String |
TAB
|
(package private) FarragoTypeFactory |
typeFactory
|
(package private) RelDataType[] |
types
|
Constructor Summary | |
---|---|
FlatFileBcpFile(String filePath,
FarragoTypeFactory typeFactory)
|
Method Summary | |
---|---|
private boolean |
changeLength(String origVal,
String newVal)
|
private boolean |
changeType(String origType,
String newType)
|
static SqlTypeName |
convertBCPSqlToSqlType(String datatype)
Converts a BCP SQL type to one of SqlTypeName |
boolean |
create()
Starts a new bcp file, writes just the version number |
private String |
escape(char in)
Assumes from FlatFileParams that the only escaped delimiter
strings are \n and \t |
boolean |
exists()
Checks if this file exists |
private boolean |
expandRowsAndWrite(String[] row,
FlatFileParams params)
|
static RelDataType |
forceSingleByte(RelDataTypeFactory typeFactory,
RelDataType type)
|
private String |
getType(String in)
Guess type of String to be one of VARCHAR, FLOAT, BIGINT, INTEGER |
private String |
getTypeLength(String in)
|
private EigenbaseException |
newParseError(int line)
|
boolean |
parse()
Parses a control file for the datatypes and column names |
void |
update(String[] row,
boolean isHeader)
Updates, if necessary, the control file's host file data types and lengths, given a table row of information |
boolean |
write(String[] row,
FlatFileParams params)
Writes the main body of the control file, given a table row |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private static final String NEWLINE
private static final String QUOTE
private static final String TAB
private static final Pattern IntegerPattern
private static final Pattern DoublePattern
private static final String EmptyLinePattern
FileWriter ctrlWriter
RelDataType[] types
FarragoTypeFactory typeFactory
File ctrlFile
String fileName
String[] colDataType
String[] colDataLength
String[] colNames
Constructor Detail |
---|
FlatFileBcpFile(String filePath, FarragoTypeFactory typeFactory)
Method Detail |
---|
public boolean exists()
public boolean create()
public boolean write(String[] row, FlatFileParams params)
public void update(String[] row, boolean isHeader)
private boolean changeType(String origType, String newType)
private boolean changeLength(String origVal, String newVal)
private boolean expandRowsAndWrite(String[] row, FlatFileParams params)
private String escape(char in)
FlatFileParams
that the only escaped delimiter
strings are \n and \t
private String getType(String in)
private String getTypeLength(String in)
public boolean parse()
public static RelDataType forceSingleByte(RelDataTypeFactory typeFactory, RelDataType type)
private EigenbaseException newParseError(int line)
public static SqlTypeName convertBCPSqlToSqlType(String datatype)
SqlTypeName
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |