Skip to content

Commit

Permalink
Added a -v, --version flag to get the version of the DataSync jar bei…
Browse files Browse the repository at this point in the history
…ng run.

Removed the resource name from schemas on port jobs so they don't fail.

Reviewed-by: franklin
  • Loading branch information
ayn leslie committed Sep 23, 2014
1 parent 745dcc7 commit 3d2b62b
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/main/java/com/socrata/datasync/Main.java
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ public static void main(String[] args) throws ParseException {
} else if(args.length == 1) {
if(args[0].equals("-?") || args[0].equals("--help")) {
printHelp();
} else if (args[0].equals("-v") || args[0].equals("--version")) {
System.out.println("DataSync version " + VersionProvider.getThisVersion());
} else {
// Run a job file (.sij) in command-line mode
String jobFileToRun = args[0];
Expand Down
3 changes: 3 additions & 0 deletions src/main/java/com/socrata/datasync/PortUtility.java
Original file line number Diff line number Diff line change
Expand Up @@ -175,9 +175,12 @@ public static JobStatus assertSchemasAreAlike(SodaDdl sourceChecker, SodaDdl sin
* with a grouping_aggregrate but no group-by). The editing of the field name is necessary for subsequent
* data loading, since the data from soda2 expectst aggregated columns to include the grouping_aggregate.
* Also removes drill-down formatting info, as this is non-sensical without the unaggregated data
* Also removing the resourceName - no port job can succeed with one present.
* @param schema the Dataset from soda-java representing the schema
*/
public static void adaptSchemaForAggregates(Dataset schema) {
// TODO: give users the option to choose a new resource name; in the meanwhile, it can be set after the job completes
schema.setResourceName(null);
List<Column> columns = schema.getColumns();
for (int i = 0; i < columns.size(); i++) {
Column col = columns.get(i);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ public class CommandLineOptions {
options.addOption("pdt", DESTINATION_DATASET_TITLE_FLAG, true, "Destination Dataset Title (optional) [PortJob]");

options.addOption("?", "help", false, "Help");
options.addOption("v", "version", false, "DataSync version");
}

public static CommandLine getCommandLine(String[] args) throws ParseException, ParseException {
Expand Down

0 comments on commit 3d2b62b

Please sign in to comment.