Permalink
Browse files

Tpch working with tbl files

  • Loading branch information...
rogerioacp committed Apr 8, 2015
1 parent eb7a326 commit b160bc9daf7e4aa6e4d7d72259f76a5929f05e35
View
@@ -0,0 +1,10 @@
<?xml version="1.0"?>
<parameters>
<!-- Connection details -->
<dbtype>sqlite</dbtype>
<driver>org.sqlite.JDBC</driver>
<DBUrl>jdbc:sqlite:dbs/tpch1</DBUrl>
<isolation>TRANSACTION_READ_COMMITTED</isolation>
<datadir>tpch/dbgen</datadir><!--Location for the files generated by tpch-->
<fileFormat>tbl</fileFormat> <!--Format of the files that contain the tpch data, csv or tbl-->
</parameters>
@@ -24,4 +24,4 @@
application.args=
javac.debug=true
javadoc.preview=true
user.properties.file=C:\\Users\\Roger\\AppData\\Roaming\\NetBeans\\8.0.2\\build.properties
user.properties.file=/home/roger/.netbeans/8.0.2/build.properties
@@ -315,10 +315,10 @@ protected long loadHelper() {
private String getFileFormat(){
String format = workConf.getXmlConfig().getString("fileFormat");
if(format == null || !"csv".equals(format)||!"csv".equals("tbl")){
throw new IllegalArgumentException("Configuration does"
+ "not have a valid fileFormat");
if(format == null ||
(!"csv".equals(format) && !"tbl".equals(format))){
throw new IllegalArgumentException("Configuration doesent"
+ " have a valid fileFormat");
}
return format;
}
@@ -331,7 +331,7 @@ private Pattern getFormatPattern(String format){
// double-quoted have the quotes dropped (we don't need them).
return Pattern.compile("\\s*(\"[^\"]*\"|[^,]*)\\s*,?");
}else{
return Pattern.compile("[^\\|]*|");
return Pattern.compile("[^\\|]*\\|");
}
}
@@ -389,6 +389,7 @@ public void run() {
if (field.charAt(0) == '\"') {
field = field.substring(1, field.length() - 1);
}
if(group==0){
field = field.substring(0, field.length() -1);
}

0 comments on commit b160bc9

Please sign in to comment.