id stringlengths 7 14 | test_class dict | test_case dict | focal_class dict | focal_method dict | repository dict |
|---|---|---|---|---|---|
47536480_120 | {
"fields": [
{
"declarator": "gmt = TimeZone.getTimeZone(\"GMT+8\")",
"modifier": "",
"original_string": "TimeZone gmt = TimeZone.getTimeZone(\"GMT+8\");",
"type": "TimeZone",
"var_name": "gmt"
}
],
"file": "odps-console-dship/src/test/java/com/aliyun/odps/ship/common/Record... | {
"body": "@Test\n public void testNullReuse() throws Exception {\n TableSchema rs = new TableSchema();\n rs.addColumn(new Column(\"i1\", OdpsType.BIGINT));\n\n String[] l0 = new String[] {\"2\"};\n String[] l1 = new String[] {\"NULL\"};\n String[] l2 = new String[] {\"1\"};\n RecordConverter cv = ... | {
"fields": [
{
"declarator": "ZEROS = \"000000000\"",
"modifier": "private static final",
"original_string": "private static final String ZEROS = \"000000000\";",
"type": "String",
"var_name": "ZEROS"
},
{
"declarator": "nullBytes",
"modifier": "private final",
... | {
"body": "public Record parse(byte[][] line) throws ParseException, UnsupportedEncodingException {\n\n if (line == null) {\n return null;\n }\n int cols = schema.getColumns().size();\n\n if (isStrictSchema && line.length != cols) {\n throw new ParseException(Constants.ERROR_INDICATOR + \"column... | {
"created": null,
"fork": null,
"fork_count": 21,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 47536480,
"size": 16942,
"stargazer_count": 58,
"stars": null,
"updates": null,
"url": "https://github.com/aliyun/aliyun-odps-console"
} |
47536480_52 | {
"fields": [
{
"declarator": "VOLUME_NAME = \"test_volume\"",
"modifier": "public static",
"original_string": "public static String VOLUME_NAME = \"test_volume\";",
"type": "String",
"var_name": "VOLUME_NAME"
},
{
"declarator": "odps",
"modifier": "private static... | {
"body": "@Test\n public void testAddResourceVolueArchiveNeg2() throws ODPSConsoleException {\n ExecutionContext context = ExecutionContext.init();\n String commandText = null;\n AddResourceCommand command;\n\n commandText = \"add volumeblabla b.a as b.a\";\n // A warning will be output to console\n... | {
"fields": [
{
"declarator": "HELP_TAGS = new String[]{\"add\", \"create\", \"resource\"}",
"modifier": "public static final",
"original_string": "public static final String[] HELP_TAGS = new String[]{\"add\", \"create\", \"resource\"};",
"type": "String[]",
"var_name": "HELP_TAGS"
... | {
"body": "public static AddResourceCommand parse(String commandString, ExecutionContext sessionContext)\n throws ODPSConsoleException {\n\n /*\n * !HACK: filter ADD <object type> <object name> TO PACKAGE <package name>\n * [WITH PRIVILEGES privileges];\n */\n if (isSecurityCommand(commandStrin... | {
"created": null,
"fork": null,
"fork_count": 21,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 47536480,
"size": 16942,
"stargazer_count": 58,
"stars": null,
"updates": null,
"url": "https://github.com/aliyun/aliyun-odps-console"
} |
47536480_29 | {
"fields": [],
"file": "odps-console-public/src/test/java/com/aliyun/openservices/odps/console/pub/DescribeProjectCommandTest.java",
"identifier": "DescribeProjectCommandTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test(expected = ODPSConsoleException.class)\n public void testDescribeProjectCommandNeg()\n throws ODPSConsoleException, OdpsException {\n ExecutionContext context = ExecutionContext.init();\n Odps odps = OdpsConnectionFactory.createOdps(context);\n AbstractCommand command = DescribeProject... | {
"fields": [
{
"declarator": "projectName",
"modifier": "private final",
"original_string": "private final String projectName;",
"type": "String",
"var_name": "projectName"
},
{
"declarator": "extended",
"modifier": "private",
"original_string": "private bo... | {
"body": "public static AbstractCommand parse(String cmd, ExecutionContext ctx)\n throws ODPSConsoleException {\n if (cmd == null || ctx == null) {\n return null;\n }\n\n String[] tokens = new AntlrObject(cmd).getTokenStringArray();\n\n if (tokens.length < 2) {\n return null;\n }\n\n ... | {
"created": null,
"fork": null,
"fork_count": 21,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 47536480,
"size": 16942,
"stargazer_count": 58,
"stars": null,
"updates": null,
"url": "https://github.com/aliyun/aliyun-odps-console"
} |
47536480_91 | {
"fields": [
{
"declarator": "expectEx = ExpectedException.none()",
"modifier": "@Rule\n public",
"original_string": "@Rule\n public ExpectedException expectEx = ExpectedException.none();",
"type": "ExpectedException",
"var_name": "expectEx"
}
],
"file": "odps-console-xflo... | {
"body": "@Test\n public void testDescribeOnLineModelMatchNone() throws ODPSConsoleException, OdpsException {\n ExecutionContext context = ExecutionContext.init();\n String cmd = \"desc onlinemodel\";\n DescribeOnlineModelCommand command = DescribeOnlineModelCommand.parse(cmd, context);\n assertNull(com... | {
"fields": [
{
"declarator": "HELP_TAGS =\n new String[]{\"describe\", \"desc\", \"online\", \"model\", \"onlinemodel\"}",
"modifier": "public static final",
"original_string": "public static final String[]\n HELP_TAGS =\n new String[]{\"describe\", \"desc\", \"online\", \"model\... | {
"body": "public static DescribeOnlineModelCommand parse(String cmd, ExecutionContext ctx)\n throws ODPSConsoleException {\n\n if (cmd == null || ctx == null) {\n return null;\n }\n\n Matcher m = PATTERN.matcher(cmd);\n boolean match = m.matches();\n\n if (!match) {\n return null;\n ... | {
"created": null,
"fork": null,
"fork_count": 21,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 47536480,
"size": 16942,
"stargazer_count": 58,
"stars": null,
"updates": null,
"url": "https://github.com/aliyun/aliyun-odps-console"
} |
47536480_68 | {
"fields": [
{
"declarator": "context",
"modifier": "private static",
"original_string": "private static ExecutionContext context;",
"type": "ExecutionContext",
"var_name": "context"
},
{
"declarator": "odps",
"modifier": "private static",
"original_string"... | {
"body": "@Test\n public void negative() throws Exception {\n int count = 0;\n for (String cmd : negatives) {\n cmd = cmd.replaceAll(\"\\\\*\", odps.getDefaultProject());\n System.out.println(cmd);\n try {\n AbstractCommand command = DescribeResourceCommand.parse(cmd, context);\n } ... | {
"fields": [
{
"declarator": "projectName",
"modifier": "private",
"original_string": "private String projectName;",
"type": "String",
"var_name": "projectName"
},
{
"declarator": "resourceName",
"modifier": "private",
"original_string": "private String res... | {
"body": "public static DescribeResourceCommand parse(String cmd, ExecutionContext ctx)\n throws ODPSConsoleException {\n\n if (cmd == null || ctx == null) {\n return null;\n }\n\n Matcher m = PATTERN.matcher(cmd);\n boolean match = m.matches();\n\n if (!match) {\n return null;\n }\n... | {
"created": null,
"fork": null,
"fork_count": 21,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 47536480,
"size": 16942,
"stargazer_count": 58,
"stars": null,
"updates": null,
"url": "https://github.com/aliyun/aliyun-odps-console"
} |
47536480_87 | {
"fields": [
{
"declarator": "expectEx = ExpectedException.none()",
"modifier": "@Rule\n public",
"original_string": "@Rule\n public ExpectedException expectEx = ExpectedException.none();",
"type": "ExpectedException",
"var_name": "expectEx"
}
],
"file": "odps-console-xflo... | {
"body": "@Test\n public void testUpdateOnLineModelParameterError1() throws ODPSConsoleException, OdpsException {\n ExecutionContext context = ExecutionContext.init();\n String cmd = \"update onlinemodel -p prj1 model1 \" +\n \"-qos 5000 \" +\n \"-instanceNum 2 \" +\n \"-cpu 1... | {
"fields": [
{
"declarator": "HELP_TAGS = new String[]{\"update\", \"model\", \"onlinemodel\", \"online\"}",
"modifier": "public static final",
"original_string": "public static final String[] HELP_TAGS = new String[]{\"update\", \"model\", \"onlinemodel\", \"online\"};",
"type": "String[... | {
"body": "public static UpdateOnlineModelCommand parse(String cmd, ExecutionContext ctx)\n throws ODPSConsoleException {\n if (cmd == null || ctx == null) {\n return null;\n }\n\n OnlineModelInfo modelInfo = CreateOnlineModelCommand.buildOnlineModelInfo(cmd, PATTERN, ctx);\n if (modelInfo == nu... | {
"created": null,
"fork": null,
"fork_count": 21,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 47536480,
"size": 16942,
"stargazer_count": 58,
"stars": null,
"updates": null,
"url": "https://github.com/aliyun/aliyun-odps-console"
} |
47536480_69 | {
"fields": [
{
"declarator": "expectEx = ExpectedException.none()",
"modifier": "@Rule\n public",
"original_string": "@Rule\n public ExpectedException expectEx = ExpectedException.none();",
"type": "ExpectedException",
"var_name": "expectEx"
}
],
"file": "odps-console-xflo... | {
"body": "@Test\n public void testShowOnLineModelsInvalidFilter() throws ODPSConsoleException, OdpsException {\n ExecutionContext context = ExecutionContext.init();\n String cmd = \"show onlinemodels prefix-error\";\n expectEx.expect(ODPSConsoleException.class);\n expectEx.expectMessage(ODPSConsoleConst... | {
"fields": [
{
"declarator": "HELP_TAGS = new String[]{\"show\", \"online\", \"model\", \"onlinemodel\"}",
"modifier": "public static final",
"original_string": "public static final String[] HELP_TAGS = new String[]{\"show\", \"online\", \"model\", \"onlinemodel\"};",
"type": "String[]",
... | {
"body": "public static ShowOnlineModelsCommand parse(String cmd, ExecutionContext ctx)\n throws ODPSConsoleException {\n\n if (cmd == null || ctx == null) {\n return null;\n }\n Matcher matcher = PATTERN.matcher(cmd);\n\n if (!matcher.matches()) {\n return null;\n }\n\n String input... | {
"created": null,
"fork": null,
"fork_count": 21,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 47536480,
"size": 16942,
"stargazer_count": 58,
"stars": null,
"updates": null,
"url": "https://github.com/aliyun/aliyun-odps-console"
} |
47536480_86 | {
"fields": [
{
"declarator": "expectEx = ExpectedException.none()",
"modifier": "@Rule\n public",
"original_string": "@Rule\n public ExpectedException expectEx = ExpectedException.none();",
"type": "ExpectedException",
"var_name": "expectEx"
}
],
"file": "odps-console-xflo... | {
"body": "@Test\n public void testUpdateOnLineModelWithOfflineModel() throws ODPSConsoleException, OdpsException {\n ExecutionContext context = ExecutionContext.init();\n String cmd = \"update onlinemodel -p online_model_test t_offlinemodel \" +\n \"-offlinemodelProject online_model_test \" +\n ... | {
"fields": [
{
"declarator": "HELP_TAGS = new String[]{\"update\", \"model\", \"onlinemodel\", \"online\"}",
"modifier": "public static final",
"original_string": "public static final String[] HELP_TAGS = new String[]{\"update\", \"model\", \"onlinemodel\", \"online\"};",
"type": "String[... | {
"body": "public static UpdateOnlineModelCommand parse(String cmd, ExecutionContext ctx)\n throws ODPSConsoleException {\n if (cmd == null || ctx == null) {\n return null;\n }\n\n OnlineModelInfo modelInfo = CreateOnlineModelCommand.buildOnlineModelInfo(cmd, PATTERN, ctx);\n if (modelInfo == nu... | {
"created": null,
"fork": null,
"fork_count": 21,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 47536480,
"size": 16942,
"stargazer_count": 58,
"stars": null,
"updates": null,
"url": "https://github.com/aliyun/aliyun-odps-console"
} |
47536480_90 | {
"fields": [],
"file": "odps-console-xflow/src/test/java/com/aliyun/openservices/odps/console/xflow/DropOnlineModelCommandTest.java",
"identifier": "DropOnlineModelCommandTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testNegativeCommand() throws ODPSConsoleException, OdpsException {\n ExecutionContext context = ExecutionContext.init();\n String cmd = \"DropOnlineModel not_exists\";\n DropOnlineModelCommand command = DropOnlineModelCommand.parse(cmd, context);\n assertNull(command);\n }... | {
"fields": [
{
"declarator": "HELP_TAGS = new String[]{\"drop\", \"delete\", \"online\", \"model\", \"onlinemodel\"}",
"modifier": "public static final",
"original_string": "public static final String[] HELP_TAGS = new String[]{\"drop\", \"delete\", \"online\", \"model\", \"onlinemodel\"};",
... | {
"body": "public static DropOnlineModelCommand parse(String commandString, ExecutionContext sessionContext)\n throws ODPSConsoleException {\n\n boolean ifExists = false;\n \n // 检查是否符合DROP ONLINEMODEL MODEL_NAME命令\n if (commandString.toUpperCase().matches(\"\\\\s*DROP\\\\s+ONLINEMODEL\\\\s+.*\")) {\... | {
"created": null,
"fork": null,
"fork_count": 21,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 47536480,
"size": 16942,
"stargazer_count": 58,
"stars": null,
"updates": null,
"url": "https://github.com/aliyun/aliyun-odps-console"
} |
47536480_28 | {
"fields": [],
"file": "odps-console-public/src/test/java/com/aliyun/openservices/odps/console/pub/DescribeProjectCommandTest.java",
"identifier": "DescribeProjectCommandTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testDescribeProjectCommand()\n throws ODPSConsoleException, OdpsException {\n ExecutionContext context = ExecutionContext.init();\n Odps odps = OdpsConnectionFactory.createOdps(context);\n AbstractCommand\n command =\n DescribeProjectCommand.parse(\"Desc pro... | {
"fields": [
{
"declarator": "projectName",
"modifier": "private final",
"original_string": "private final String projectName;",
"type": "String",
"var_name": "projectName"
},
{
"declarator": "extended",
"modifier": "private",
"original_string": "private bo... | {
"body": "public DescribeProjectCommand(\n String projectName, boolean extended, String cmd, ExecutionContext ctx) {\n super(cmd, ctx);\n this.projectName = projectName;\n this.extended = extended;\n }",
"class_method_signature": "DescribeProjectCommand.DescribeProjectCommand(\n String projectN... | {
"created": null,
"fork": null,
"fork_count": 21,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 47536480,
"size": 16942,
"stargazer_count": 58,
"stars": null,
"updates": null,
"url": "https://github.com/aliyun/aliyun-odps-console"
} |
47536480_121 | {
"fields": [
{
"declarator": "gmt = TimeZone.getTimeZone(\"GMT+8\")",
"modifier": "",
"original_string": "TimeZone gmt = TimeZone.getTimeZone(\"GMT+8\");",
"type": "TimeZone",
"var_name": "gmt"
}
],
"file": "odps-console-dship/src/test/java/com/aliyun/odps/ship/common/Record... | {
"body": "@Test(expected = ParseException.class)\n public void testNullSet() throws Exception {\n TableSchema rs = new TableSchema();\n rs.addColumn(new Column(\"i1\", OdpsType.BIGINT));\n\n String[] l = new String[] {\"2\", \"NULL\"};\n RecordConverter cv = new RecordConverter(rs, \"NULL\", \"yyyyMMddH... | {
"fields": [
{
"declarator": "ZEROS = \"000000000\"",
"modifier": "private static final",
"original_string": "private static final String ZEROS = \"000000000\";",
"type": "String",
"var_name": "ZEROS"
},
{
"declarator": "nullBytes",
"modifier": "private final",
... | {
"body": "public Record parse(byte[][] line) throws ParseException, UnsupportedEncodingException {\n\n if (line == null) {\n return null;\n }\n int cols = schema.getColumns().size();\n\n if (isStrictSchema && line.length != cols) {\n throw new ParseException(Constants.ERROR_INDICATOR + \"column... | {
"created": null,
"fork": null,
"fork_count": 21,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 47536480,
"size": 16942,
"stargazer_count": 58,
"stars": null,
"updates": null,
"url": "https://github.com/aliyun/aliyun-odps-console"
} |
47536480_53 | {
"fields": [
{
"declarator": "VOLUME_NAME = \"test_volume\"",
"modifier": "public static",
"original_string": "public static String VOLUME_NAME = \"test_volume\";",
"type": "String",
"var_name": "VOLUME_NAME"
},
{
"declarator": "odps",
"modifier": "private static... | {
"body": "@Test\n public void testAddResourceJarNotCheck() throws ODPSConsoleException {\n ExecutionContext context = ExecutionContext.init();\n String commandText = null;\n AddResourceCommand command;\n\n commandText = \"add jar a as a.jar\";\n // A warning will be output to console\n command = A... | {
"fields": [
{
"declarator": "HELP_TAGS = new String[]{\"add\", \"create\", \"resource\"}",
"modifier": "public static final",
"original_string": "public static final String[] HELP_TAGS = new String[]{\"add\", \"create\", \"resource\"};",
"type": "String[]",
"var_name": "HELP_TAGS"
... | {
"body": "public static AddResourceCommand parse(String commandString, ExecutionContext sessionContext)\n throws ODPSConsoleException {\n\n /*\n * !HACK: filter ADD <object type> <object name> TO PACKAGE <package name>\n * [WITH PRIVILEGES privileges];\n */\n if (isSecurityCommand(commandStrin... | {
"created": null,
"fork": null,
"fork_count": 21,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 47536480,
"size": 16942,
"stargazer_count": 58,
"stars": null,
"updates": null,
"url": "https://github.com/aliyun/aliyun-odps-console"
} |
47536480_12 | {
"fields": [],
"file": "odps-console-basic/src/test/java/com/aliyun/openservices/odps/console/utils/ODPSConsoleUtilsTest.java",
"identifier": "ODPSConsoleUtilsTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testParseTableSpec() {\n test(\"tablename\", new String[] { null, \"tablename\" });\n test(\"projectname.tablename\", new String[] { \"projectname\", \"tablename\" });\n test(\".tablename\", new String[] { null, \"tablename\" });\n test(\".\", new String[] { null, null });\... | {
"fields": [
{
"declarator": "DATE_FORMAT = new SimpleDateFormat(\"yyyy-MM-dd HH:mm:ss\", Locale.getDefault())",
"modifier": "public static final",
"original_string": "public static final SimpleDateFormat DATE_FORMAT = new SimpleDateFormat(\"yyyy-MM-dd HH:mm:ss\", Locale.getDefault());",
... | {
"body": "public static String[] parseTableSpec(String str) {\n String[] r = new String[2];\n\n if (str != null && str.length() > 0) {\n int idx = str.indexOf('.');\n if (idx == -1) {\n r[1] = str;\n } else {\n r[0] = str.substring(0, idx);\n r[1] = str.substring(idx + 1, st... | {
"created": null,
"fork": null,
"fork_count": 21,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 47536480,
"size": 16942,
"stargazer_count": 58,
"stars": null,
"updates": null,
"url": "https://github.com/aliyun/aliyun-odps-console"
} |
47536480_45 | {
"fields": [
{
"declarator": "positive =\n {\"top instance \", \"toP instance \", \"TOP INSTANCE \", \"top instance -d\", \"top instance -d 10\",\n \"top instance -limit 2\", \"top instance -all\", \"top instance -p tt\",\n \"top instance -status running\",\n \"top instance -d -all -... | {
"body": "@Test\n public void testError() throws OdpsException, ODPSConsoleException {\n ExecutionContext ctx = ExecutionContext.init();\n int count = 0;\n for (String str : error) {\n try {\n TopInstanceCommand test = TopInstanceCommand.parse(str, ctx);\n } catch (ODPSConsoleException e) ... | {
"fields": [
{
"declarator": "HELP_TAGS = new String[]{\"top\", \"instance\"}",
"modifier": "public static final",
"original_string": "public static final String[] HELP_TAGS = new String[]{\"top\", \"instance\"};",
"type": "String[]",
"var_name": "HELP_TAGS"
},
{
"decl... | {
"body": "public static TopInstanceCommand parse(String commandString, ExecutionContext sessionContext)\n throws ODPSConsoleException {\n Matcher matcher = PATTERN.matcher(commandString);\n String projectName = null;\n Integer delay = null;\n Boolean onlyOwner = null;\n Integer number = null;\n ... | {
"created": null,
"fork": null,
"fork_count": 21,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 47536480,
"size": 16942,
"stargazer_count": 58,
"stars": null,
"updates": null,
"url": "https://github.com/aliyun/aliyun-odps-console"
} |
47536480_32 | {
"fields": [],
"file": "odps-console-public/src/test/java/com/aliyun/openservices/odps/console/pub/DescribeProjectCommandTest.java",
"identifier": "DescribeProjectCommandTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test(expected = ODPSConsoleException.class)\n public void testDescribeProjectExtendedNegCommand()\n throws ODPSConsoleException, OdpsException {\n ExecutionContext context = ExecutionContext.init();\n Odps odps = OdpsConnectionFactory.createOdps(context);\n AbstractCommand\n command ... | {
"fields": [
{
"declarator": "projectName",
"modifier": "private final",
"original_string": "private final String projectName;",
"type": "String",
"var_name": "projectName"
},
{
"declarator": "extended",
"modifier": "private",
"original_string": "private bo... | {
"body": "public static AbstractCommand parse(String cmd, ExecutionContext ctx)\n throws ODPSConsoleException {\n if (cmd == null || ctx == null) {\n return null;\n }\n\n String[] tokens = new AntlrObject(cmd).getTokenStringArray();\n\n if (tokens.length < 2) {\n return null;\n }\n\n ... | {
"created": null,
"fork": null,
"fork_count": 21,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 47536480,
"size": 16942,
"stargazer_count": 58,
"stars": null,
"updates": null,
"url": "https://github.com/aliyun/aliyun-odps-console"
} |
47536480_65 | {
"fields": [
{
"declarator": "thrown= ExpectedException.none()",
"modifier": "@Rule\n public",
"original_string": "@Rule\n public ExpectedException thrown= ExpectedException.none();",
"type": "ExpectedException",
"var_name": "thrown"
}
],
"file": "odps-console-resource/src... | {
"body": "@Test\n public void testDropFunctionCommandPositive() throws ODPSConsoleException {\n ExecutionContext ctx = ExecutionContext.init();\n DropFunctionCommand command = null;\n command = DropFunctionCommand.parse(\"drop function test_drop\", ctx);\n Assert.assertNotNull(command);\n Assert.asse... | {
"fields": [
{
"declarator": "HELP_TAGS = new String[]{\"drop\", \"delete\", \"function\"}",
"modifier": "public static final",
"original_string": "public static final String[] HELP_TAGS = new String[]{\"drop\", \"delete\", \"function\"};",
"type": "String[]",
"var_name": "HELP_TAGS... | {
"body": "public static DropFunctionCommand parse(String commandString, ExecutionContext sessionContext)\n throws ODPSConsoleException {\n\n String[] args = CommandParserUtils.getCommandTokens(commandString);\n if (args.length < 2) {\n return null;\n }\n\n // 检查是否符合DROP FUNCTION FUNCTION_NAME命令... | {
"created": null,
"fork": null,
"fork_count": 21,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 47536480,
"size": 16942,
"stargazer_count": 58,
"stars": null,
"updates": null,
"url": "https://github.com/aliyun/aliyun-odps-console"
} |
47536480_117 | {
"fields": [
{
"declarator": "originalCharset",
"modifier": "static",
"original_string": "static String originalCharset;",
"type": "String",
"var_name": "originalCharset"
}
],
"file": "odps-console-dship/src/test/java/com/aliyun/odps/ship/upload/BlockRecordReaderTest.java",
... | {
"body": "@Test\n public void testReadIgnoreHeader() throws Exception {\n /**\n * file content 123,abc 234,bbb, first line will ignore\n * */\n BlockInfo blockInfo = new BlockInfo(1L, new File(\"src/test/resources/file/reader/one_char_split.txt\"), 0L, 15L);\n BlockRecordReader reader = new BlockRe... | {
"fields": [
{
"declarator": "fieldDelimiter",
"modifier": "private",
"original_string": "private byte[] fieldDelimiter;",
"type": "byte[]",
"var_name": "fieldDelimiter"
},
{
"declarator": "recordDelimiter",
"modifier": "private",
"original_string": "privat... | {
"body": "public byte[][] readTextRecord() throws IOException {\n if (isLastLine) {\n return null;\n }\n currentLine = readLine();\n isLastLine = startPos + readBytes > blockInfo.getStartPos() + blockInfo.getLength();\n return splitLine(currentLine);\n }",
"class_method_signature": "BlockRecor... | {
"created": null,
"fork": null,
"fork_count": 21,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 47536480,
"size": 16942,
"stargazer_count": 58,
"stars": null,
"updates": null,
"url": "https://github.com/aliyun/aliyun-odps-console"
} |
47536480_101 | {
"fields": [
{
"declarator": "expectEx = ExpectedException.none()",
"modifier": "@Rule\n public",
"original_string": "@Rule\n public ExpectedException expectEx = ExpectedException.none();",
"type": "ExpectedException",
"var_name": "expectEx"
}
],
"file": "odps-console-xflo... | {
"body": "@Test\n public void testCreateOnLineModelParameterError4() throws ODPSConsoleException, OdpsException {\n ExecutionContext context = ExecutionContext.init();\n String cmd = \"create onlinemodel -p prj1 model1 \" +\n \"-target target1 \" +\n \"-id id1 \" +\n \"-libNam... | {
"fields": [
{
"declarator": "HELP_TAGS = new String[]{\"create\", \"model\", \"onlinemodel\", \"online\"}",
"modifier": "public static final",
"original_string": "public static final String[] HELP_TAGS = new String[]{\"create\", \"model\", \"onlinemodel\", \"online\"};",
"type": "String[... | {
"body": "public static CreateOnlineModelCommand parse(String cmd, ExecutionContext ctx)\n throws ODPSConsoleException {\n\n if (cmd == null || ctx == null) {\n return null;\n }\n\n OnlineModelInfo modelInfo = CreateOnlineModelCommand.buildOnlineModelInfo(cmd, PATTERN, ctx);\n if (modelInfo == ... | {
"created": null,
"fork": null,
"fork_count": 21,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 47536480,
"size": 16942,
"stargazer_count": 58,
"stars": null,
"updates": null,
"url": "https://github.com/aliyun/aliyun-odps-console"
} |
47536480_73 | {
"fields": [
{
"declarator": "expectEx = ExpectedException.none()",
"modifier": "@Rule\n public",
"original_string": "@Rule\n public ExpectedException expectEx = ExpectedException.none();",
"type": "ExpectedException",
"var_name": "expectEx"
}
],
"file": "odps-console-xflo... | {
"body": "@Test\n public void testCreateOffLineModelWithBoth() throws ODPSConsoleException, OdpsException {\n ExecutionContext context = ExecutionContext.init();\n String cmd = \"create offlinemodel t_offlinemodel \" +\n \"-modelPath oss://bucket/dir/?role_arn=xxx&host=yyy \" +\n \"-proc... | {
"fields": [
{
"declarator": "HELP_TAGS = new String[]{\"create\", \"offline\", \"model\", \"offlinemodel\"}",
"modifier": "public static final",
"original_string": "public static final String[] HELP_TAGS = new String[]{\"create\", \"offline\", \"model\", \"offlinemodel\"};",
"type": "Str... | {
"body": "public static CreateOfflineModelCommand parse(String cmd, ExecutionContext ctx)\n throws ODPSConsoleException {\n\n if (cmd == null || ctx == null) {\n return null;\n }\n\n OfflineModelInfo modelInfo = CreateOfflineModelCommand.buildOfflineModelInfo(cmd, PATTERN, ctx);\n\n if (modelIn... | {
"created": null,
"fork": null,
"fork_count": 21,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 47536480,
"size": 16942,
"stargazer_count": 58,
"stars": null,
"updates": null,
"url": "https://github.com/aliyun/aliyun-odps-console"
} |
47536480_24 | {
"fields": [
{
"declarator": "TEST_TABLE_NAME = \"test_wait_command\"",
"modifier": "private static",
"original_string": "private static String TEST_TABLE_NAME = \"test_wait_command\";",
"type": "String",
"var_name": "TEST_TABLE_NAME"
}
],
"file": "odps-console-public/src/te... | {
"body": "@Test\n public void testWaitCommand() throws ODPSConsoleException, OdpsException {\n ExecutionContext context = ExecutionContext.init();\n Odps odps = OdpsConnectionFactory.createOdps(context);\n Instance instance = SQLTask.run(odps, \"select count(*) from \" + TEST_TABLE_NAME + \";\");\n Stri... | {
"fields": [
{
"declarator": "HELP_TAGS = new String[]{\"wait\", \"instance\"}",
"modifier": "public static final",
"original_string": "public static final String[] HELP_TAGS = new String[]{\"wait\", \"instance\"};",
"type": "String[]",
"var_name": "HELP_TAGS"
},
{
"de... | {
"body": "private WaitCommand(String id, boolean triggerHooks, String cmd, ExecutionContext ctx) {\n super(cmd, ctx);\n this.id = id;\n this.triggerHooks = triggerHooks;\n }",
"class_method_signature": "WaitCommand.WaitCommand(String id, boolean triggerHooks, String cmd, ExecutionContext ctx)",
"constr... | {
"created": null,
"fork": null,
"fork_count": 21,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 47536480,
"size": 16942,
"stargazer_count": 58,
"stars": null,
"updates": null,
"url": "https://github.com/aliyun/aliyun-odps-console"
} |
47536480_6 | {
"fields": [],
"file": "odps-console-basic/src/test/java/com/aliyun/openservices/odps/console/commands/ExecuteScriptCommandTest.java",
"identifier": "ExecuteScriptCommandTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testNegative() throws ODPSConsoleException, OdpsException {\n ExecutionContext context = ExecutionContext.init();\n ExecuteScriptCommand command = null;\n\n List<String> options = new ArrayList<String>();\n options.add(\"-f\");\n\n options.add(ODPSConsoleUtils.getConfigF... | {
"fields": [
{
"declarator": "filename",
"modifier": "private",
"original_string": "private String filename;",
"type": "String",
"var_name": "filename"
}
],
"file": "odps-console-basic/src/main/java/com/aliyun/openservices/odps/console/commands/ExecuteScriptCommand.java",
... | {
"body": "public static ExecuteScriptCommand parse(List<String> optionList, ExecutionContext sessionContext)\n throws ODPSConsoleException {\n // 处理script的执行\n // parse -s参数\n String option = \"-s\";\n\n if (optionList.contains(option)) {\n if (optionList.indexOf(option) + 1 < optionList.size()... | {
"created": null,
"fork": null,
"fork_count": 21,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 47536480,
"size": 16942,
"stargazer_count": 58,
"stars": null,
"updates": null,
"url": "https://github.com/aliyun/aliyun-odps-console"
} |
47536480_49 | {
"fields": [
{
"declarator": "VOLUME_NAME = \"test_volume\"",
"modifier": "public static",
"original_string": "public static String VOLUME_NAME = \"test_volume\";",
"type": "String",
"var_name": "VOLUME_NAME"
},
{
"declarator": "odps",
"modifier": "private static... | {
"body": "@Test\n public void testIsSecurityCommand() {\n assertTrue(AddResourceCommand.isSecurityCommand(\"add table t1 to package testpack\"));\n assertTrue(AddResourceCommand\n .isSecurityCommand(\"add table t1 to package testpack WITH PRIVILEGES privileges\"));\n assertTrue(AddResourceCommand.is... | {
"fields": [
{
"declarator": "HELP_TAGS = new String[]{\"add\", \"create\", \"resource\"}",
"modifier": "public static final",
"original_string": "public static final String[] HELP_TAGS = new String[]{\"add\", \"create\", \"resource\"};",
"type": "String[]",
"var_name": "HELP_TAGS"
... | {
"body": "public static boolean isSecurityCommand(String cmd) {\n if (cmd == null || cmd.length() == 0) {\n return false;\n }\n\n boolean r = false;\n Matcher m = TO_PACKAGE_REGEX.matcher(cmd);\n if (m != null && m.matches()) {\n r = true;\n }\n return r;\n }",
"class_method_signatu... | {
"created": null,
"fork": null,
"fork_count": 21,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 47536480,
"size": 16942,
"stargazer_count": 58,
"stars": null,
"updates": null,
"url": "https://github.com/aliyun/aliyun-odps-console"
} |
47536480_130 | {
"fields": [
{
"declarator": "TEST_TABLE_NAME = \"file_downloader_test\"",
"modifier": "private static final",
"original_string": "private static final String TEST_TABLE_NAME = \"file_downloader_test\";",
"type": "String",
"var_name": "TEST_TABLE_NAME"
},
{
"declarator... | {
"body": "@Test\n public void testDownloadSlice_SelecteColumns() throws Exception {\n String[] args =\n new String[]{\"download\", projectName + \".\" + TEST_TABLE_NAME + \"/ds='2113',pt='pttest'\",\n \"src/test/resources/file/filedownloader/tmp_partial.txt\", \"-fd=||\", \"-rd=\\n\",\... | {
"fields": [
{
"declarator": "path",
"modifier": "private final",
"original_string": "private final String path;",
"type": "String",
"var_name": "path"
},
{
"declarator": "start",
"modifier": "private final",
"original_string": "private final Long start;",
... | {
"body": "public void download() throws IOException, TunnelException {\n if (sh != null) {\n String msg = String.format(\"file [\" + id + \"] start\");\n sh.log(msg);\n System.err.println(sim.format(new Date()) + \" - \" + msg);\n }\n\n String fd = DshipContext.INSTANCE.get(Constants.FIELD_... | {
"created": null,
"fork": null,
"fork_count": 21,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 47536480,
"size": 16942,
"stargazer_count": 58,
"stars": null,
"updates": null,
"url": "https://github.com/aliyun/aliyun-odps-console"
} |
47536480_42 | {
"fields": [
{
"declarator": "positives = { \"DESCRIBE project_name.table_name\",\n \"DESC project_name.table_name\", \"desc project_name.table_name\",\n \"\\r\\n\\tDesCribe\\r\\n\\tproject_name.table_name\\r\\t\\n\" }",
"modifier": "private static final",
"original_string": "private ... | {
"body": "@Test\n public void testCommandNeagetive() throws ODPSConsoleException {\n ExecutionContext context = ExecutionContext.init();\n for (String cmd : negatives) {\n AbstractCommand command = DescribeTableCommand.parse(cmd, context);\n assertNull(command);\n }\n }",
"class_method_signatu... | {
"fields": [
{
"declarator": "project",
"modifier": "private",
"original_string": "private String project;",
"type": "String",
"var_name": "project"
},
{
"declarator": "table",
"modifier": "private",
"original_string": "private String table;",
"type":... | {
"body": "public static DescribeTableCommand parse(String cmd, ExecutionContext cxt) {\n if (cmd == null || cxt == null) {\n return null;\n }\n\n DescribeTableCommand r = null;\n Matcher m = PATTERN.matcher(cmd);\n boolean match = m.matches();\n\n if (!match) {\n return r;\n }\n\n c... | {
"created": null,
"fork": null,
"fork_count": 21,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 47536480,
"size": 16942,
"stargazer_count": 58,
"stars": null,
"updates": null,
"url": "https://github.com/aliyun/aliyun-odps-console"
} |
47536480_15 | {
"fields": [],
"file": "odps-console-basic/src/test/java/com/aliyun/openservices/odps/console/utils/ODPSConsoleUtilsTest.java",
"identifier": "ODPSConsoleUtilsTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testCompareVersion() throws Exception {\n Assert.assertEquals(0, ODPSConsoleUtils.compareVersion(\"0.24.0\", \"0.24.0\"));\n Assert.assertEquals(-1, ODPSConsoleUtils.compareVersion(\"0.24.0\", \"0.24.1\"));\n Assert.assertEquals(1, ODPSConsoleUtils.compareVersion(\"0.24.1\", \... | {
"fields": [
{
"declarator": "DATE_FORMAT = new SimpleDateFormat(\"yyyy-MM-dd HH:mm:ss\", Locale.getDefault())",
"modifier": "public static final",
"original_string": "public static final SimpleDateFormat DATE_FORMAT = new SimpleDateFormat(\"yyyy-MM-dd HH:mm:ss\", Locale.getDefault());",
... | {
"body": "public static int compareVersion(String left, String right) {\n if (left.equals(right)) {\n return 0;\n }\n\n String pattern = \"[\\\\\\\\.\\\\\\\\_\\\\\\\\-]\";\n String[] leftArray = left.split(pattern);\n String[] rightArray = right.split(pattern);\n\n int length = leftArray.lengt... | {
"created": null,
"fork": null,
"fork_count": 21,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 47536480,
"size": 16942,
"stargazer_count": 58,
"stars": null,
"updates": null,
"url": "https://github.com/aliyun/aliyun-odps-console"
} |
47536480_54 | {
"fields": [
{
"declarator": "VOLUME_NAME = \"test_volume\"",
"modifier": "public static",
"original_string": "public static String VOLUME_NAME = \"test_volume\";",
"type": "String",
"var_name": "VOLUME_NAME"
},
{
"declarator": "odps",
"modifier": "private static... | {
"body": "@Test\n public void testAddResourcePyNotCheck() throws ODPSConsoleException {\n ExecutionContext context = ExecutionContext.init();\n String commandText = null;\n AddResourceCommand command;\n\n commandText = \"add py a as a.py\";\n // A warning will be output to console\n command = AddR... | {
"fields": [
{
"declarator": "HELP_TAGS = new String[]{\"add\", \"create\", \"resource\"}",
"modifier": "public static final",
"original_string": "public static final String[] HELP_TAGS = new String[]{\"add\", \"create\", \"resource\"};",
"type": "String[]",
"var_name": "HELP_TAGS"
... | {
"body": "public static AddResourceCommand parse(String commandString, ExecutionContext sessionContext)\n throws ODPSConsoleException {\n\n /*\n * !HACK: filter ADD <object type> <object name> TO PACKAGE <package name>\n * [WITH PRIVILEGES privileges];\n */\n if (isSecurityCommand(commandStrin... | {
"created": null,
"fork": null,
"fork_count": 21,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 47536480,
"size": 16942,
"stargazer_count": 58,
"stars": null,
"updates": null,
"url": "https://github.com/aliyun/aliyun-odps-console"
} |
47536480_126 | {
"fields": [
{
"declarator": "TEST_TABLE_NAME = \"options_builder_test\"",
"modifier": "private final static",
"original_string": "private final static String TEST_TABLE_NAME = \"options_builder_test\";",
"type": "String",
"var_name": "TEST_TABLE_NAME"
}
],
"file": "odps-con... | {
"body": "@Test(expected = IllegalArgumentException.class)\n public void testCheckParameters() throws Exception {\n OptionsBuilder.buildUploadOption(\n new String[]{\"upload\", \"src/test/resources/many_record.txt\", TEST_TABLE_NAME});\n DshipContext.INSTANCE.put(Constants.THREADS, \"1\");\n\n try {... | {
"fields": [
{
"declarator": "UNICODE_PATTERN = Pattern.compile(\"\\\\\\\\u([0-9a-fA-F]{4})\")",
"modifier": "private static final",
"original_string": "private static final Pattern UNICODE_PATTERN = Pattern.compile(\"\\\\\\\\u([0-9a-fA-F]{4})\");",
"type": "Pattern",
"var_name": "U... | {
"body": "public static void checkParameters(String type) {\n checkDelimiters(type);\n\n String project = DshipContext.INSTANCE.get(Constants.TABLE_PROJECT);\n if (project != null && (project.trim().isEmpty())) {\n throw new IllegalArgumentException(\"Project is empty.\\nType 'tunnel help \" + type + \... | {
"created": null,
"fork": null,
"fork_count": 21,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 47536480,
"size": 16942,
"stargazer_count": 58,
"stars": null,
"updates": null,
"url": "https://github.com/aliyun/aliyun-odps-console"
} |
47536480_78 | {
"fields": [
{
"declarator": "expectEx = ExpectedException.none()",
"modifier": "@Rule\n public",
"original_string": "@Rule\n public ExpectedException expectEx = ExpectedException.none();",
"type": "ExpectedException",
"var_name": "expectEx"
}
],
"file": "odps-console-xflo... | {
"body": "@Test\n public void testReadOffLineModelNoModel() throws ODPSConsoleException, OdpsException {\n ExecutionContext context = ExecutionContext.init();\n String cmd = \"read offlinemodel -p prj\";\n expectEx.expect(ODPSConsoleException.class);\n expectEx.expectMessage(ODPSConsoleConstants.BAD_COM... | {
"fields": [
{
"declarator": "HELP_TAGS = new String[]{\"read\", \"offline\", \"model\", \"offlinemodel\"}",
"modifier": "public static final",
"original_string": "public static final String[] HELP_TAGS = new String[]{\"read\", \"offline\", \"model\", \"offlinemodel\"};",
"type": "String[... | {
"body": "public static ReadOfflineModelCommand parse(String cmd, ExecutionContext ctx)\n throws ODPSConsoleException {\n\n if (cmd == null || ctx == null) {\n return null;\n }\n\n Matcher m = PATTERN.matcher(cmd);\n if (!m.matches()) {\n return null;\n }\n\n String input = m.group(1... | {
"created": null,
"fork": null,
"fork_count": 21,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 47536480,
"size": 16942,
"stargazer_count": 58,
"stars": null,
"updates": null,
"url": "https://github.com/aliyun/aliyun-odps-console"
} |
47536480_97 | {
"fields": [
{
"declarator": "expectEx = ExpectedException.none()",
"modifier": "@Rule\n public",
"original_string": "@Rule\n public ExpectedException expectEx = ExpectedException.none();",
"type": "ExpectedException",
"var_name": "expectEx"
}
],
"file": "odps-console-xflo... | {
"body": "@Test\n public void testCreateOnLineModelWithJavaModel() throws ODPSConsoleException, OdpsException {\n ExecutionContext context = ExecutionContext.init();\n String cmd = \"create onlinemodel t_3rd_jar \" +\n \"-target abc \" +\n \"-id com.aliyun.openservices.odps.predict.pmml.... | {
"fields": [
{
"declarator": "HELP_TAGS = new String[]{\"create\", \"model\", \"onlinemodel\", \"online\"}",
"modifier": "public static final",
"original_string": "public static final String[] HELP_TAGS = new String[]{\"create\", \"model\", \"onlinemodel\", \"online\"};",
"type": "String[... | {
"body": "public static CreateOnlineModelCommand parse(String cmd, ExecutionContext ctx)\n throws ODPSConsoleException {\n\n if (cmd == null || ctx == null) {\n return null;\n }\n\n OnlineModelInfo modelInfo = CreateOnlineModelCommand.buildOnlineModelInfo(cmd, PATTERN, ctx);\n if (modelInfo == ... | {
"created": null,
"fork": null,
"fork_count": 21,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 47536480,
"size": 16942,
"stargazer_count": 58,
"stars": null,
"updates": null,
"url": "https://github.com/aliyun/aliyun-odps-console"
} |
47536480_81 | {
"fields": [],
"file": "odps-console-xflow/src/test/java/com/aliyun/openservices/odps/console/xflow/DropOfflineModelCommandTest.java",
"identifier": "DropOfflineModelCommandTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testNegativeCommand() throws ODPSConsoleException, OdpsException {\n ExecutionContext context = ExecutionContext.init();\n String cmd = \"DropOfflineModel not_exists\";\n DropOfflineModelCommand command = DropOfflineModelCommand.parse(cmd, context);\n assertNull(command);\n... | {
"fields": [
{
"declarator": "HELP_TAGS = new String[]{\"drop\", \"delete\", \"kill\", \"offline\", \"model\", \"offlinemodel\"}",
"modifier": "public static final",
"original_string": "public static final String[] HELP_TAGS = new String[]{\"drop\", \"delete\", \"kill\", \"offline\", \"model\",... | {
"body": "public static DropOfflineModelCommand parse(String commandString, ExecutionContext sessionContext)\n throws ODPSConsoleException {\n\n boolean ifExists = false;\n \n // 检查是否符合DROP OFFLINEMODEL MODEL_NAME命令\n if (commandString.toUpperCase().matches(\"\\\\s*DROP\\\\s+OFFLINEMODEL\\\\s+.*\"))... | {
"created": null,
"fork": null,
"fork_count": 21,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 47536480,
"size": 16942,
"stargazer_count": 58,
"stars": null,
"updates": null,
"url": "https://github.com/aliyun/aliyun-odps-console"
} |
47536480_39 | {
"fields": [
{
"declarator": "positive = {\"kill -sync \", \"kill \", \"KiLl \", \"KILL -sync \"}",
"modifier": "private",
"original_string": "private String[] positive = {\"kill -sync \", \"kill \", \"KiLl \", \"KILL -sync \"};",
"type": "String[]",
"var_name": "positive"
},
... | {
"body": "@Test\n public void testSyncNagtive() throws ODPSConsoleException, OdpsException {\n ExecutionContext ctx = ExecutionContext.init();\n\n for (String str : nagtive) {\n StopInstanceCommand test = StopInstanceCommand.parse(str, ctx);\n assertNull(test);\n }\n }",
"class_method_signatur... | {
"fields": [
{
"declarator": "HELP_TAGS = new String[]{\"kill\", \"stop\", \"instance\"}",
"modifier": "public static final",
"original_string": "public static final String[] HELP_TAGS = new String[]{\"kill\", \"stop\", \"instance\"};",
"type": "String[]",
"var_name": "HELP_TAGS"
... | {
"body": "public static StopInstanceCommand parse(String commandString, ExecutionContext sessionContext)\n throws ODPSConsoleException {\n if (commandString.toUpperCase().startsWith(\"KILL\")) {\n\n String temp[] = commandString.trim().replaceAll(\"\\\\s+\", \" \").split(\" \");\n\n CommandLine cl ... | {
"created": null,
"fork": null,
"fork_count": 21,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 47536480,
"size": 16942,
"stargazer_count": 58,
"stars": null,
"updates": null,
"url": "https://github.com/aliyun/aliyun-odps-console"
} |
47536480_1 | {
"fields": [
{
"declarator": "selectCommandStrings = {\"select count(*) from src;\", \"select\\n\\r count(*) \\t from src;\\t\"}",
"modifier": "private",
"original_string": "private String[]\n selectCommandStrings = {\"select count(*) from src;\", \"select\\n\\r count(*) \\t from src;\\t\"... | {
"body": "@Test\n public void testParse() throws ODPSConsoleException, OdpsException {\n ExecutionContext context = ExecutionContext.init();\n for (String cmd : selectCommandStrings) {\n QueryCommand command = QueryCommand.parse(cmd, context);\n assertNotNull(command);\n Assert.assertTrue(comma... | {
"fields": [
{
"declarator": "taskName = \"\"",
"modifier": "private",
"original_string": "private String taskName = \"\";",
"type": "String",
"var_name": "taskName"
},
{
"declarator": "isSelectCommand = false",
"modifier": "private",
"original_string": "pr... | {
"body": "public static QueryCommand parse(String commandString, ExecutionContext sessionContext) {\n\n boolean isSelect = false;\n commandString = commandString.trim();\n\n if (commandString.toUpperCase().matches(\"^SELECT[\\\\s\\\\S]*\")) {\n isSelect = true;\n }\n\n if (!commandString.endsWith... | {
"created": null,
"fork": null,
"fork_count": 21,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 47536480,
"size": 16942,
"stargazer_count": 58,
"stars": null,
"updates": null,
"url": "https://github.com/aliyun/aliyun-odps-console"
} |
47536480_19 | {
"fields": [
{
"declarator": "commandString1 = \"command_test2:100,command_test1:3000,command_test5:-100,command_test3:0,command_test4:-1\"",
"modifier": "public",
"original_string": "public String commandString1 = \"command_test2:100,command_test1:3000,command_test5:-100,command_test3:0,comman... | {
"body": "@Test(expected = Exception.class)\n public void priorityTypeErrorTest() throws Exception {\n List<PluginPriorityCommand> commandList = new ArrayList<PluginPriorityCommand>();\n\n PluginUtil.getPriorityCommandFromString(commandList, commandString3);\n }",
"class_method_signature": "PluginUtilTest.... | {
"fields": [],
"file": "odps-console-basic/src/main/java/com/aliyun/openservices/odps/console/utils/PluginUtil.java",
"identifier": "PluginUtil",
"interfaces": "",
"methods": [
{
"class_method_signature": "PluginUtil.getRootPath()",
"constructor": false,
"full_signature": "public static... | {
"body": "public static void getPriorityCommandFromString(List<PluginPriorityCommand> commands,\n String commandString) throws Exception {\n try {\n if (commandString != null) {\n String[] parts = commandString.split(\",\");\n for (String cmd : p... | {
"created": null,
"fork": null,
"fork_count": 21,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 47536480,
"size": 16942,
"stargazer_count": 58,
"stars": null,
"updates": null,
"url": "https://github.com/aliyun/aliyun-odps-console"
} |
47536480_58 | {
"fields": [],
"file": "odps-console-resource/src/test/java/com/aliyun/openservices/odps/console/resource/CreateResourceCommandTest.java",
"identifier": "CreateResourceCommandTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testCreateResourceCommandParser() throws OdpsException, ODPSConsoleException {\n ExecutionContext context = ExecutionContext.init();\n String commandText = null;\n AddResourceCommand command;\n\n // test 1\n commandText = \"create resource -f jar my_jar.jar\";\n comma... | {
"fields": [
{
"declarator": "HELP_TAGS = new String[]{\"create\", \"add\", \"resource\"}",
"modifier": "public static final",
"original_string": "public static final String[] HELP_TAGS = new String[]{\"create\", \"add\", \"resource\"};",
"type": "String[]",
"var_name": "HELP_TAGS"
... | {
"body": "public static AddResourceCommand parse(String commandString, ExecutionContext sessionContext)\n throws ODPSConsoleException {\n\n String[] tokens = new AntlrObject(commandString).getTokenStringArray();\n\n if (tokens != null && tokens.length >= 2 &&\n tokens[0].toUpperCase().equals(\"CREA... | {
"created": null,
"fork": null,
"fork_count": 21,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 47536480,
"size": 16942,
"stargazer_count": 58,
"stars": null,
"updates": null,
"url": "https://github.com/aliyun/aliyun-odps-console"
} |
47536480_23 | {
"fields": [],
"file": "odps-console-tunnel/src/test/java/com/aliyun/openservices/odps/console/tunnel/TunnelCommandTest.java",
"identifier": "TunnelCommandTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void test() throws Exception {\n ExecutionContext ctx = ExecutionContext.init();\n File temp = File.createTempFile(\"test\", null);\n temp.deleteOnExit();\n DShipCommand cmd = TunnelCommand\n .parse(\n \"upload pt_test2 partition(ds='q',pt='q') from \" + temp.g... | {
"fields": [
{
"declarator": "DSHIP_COMMAND = \"tunnel\"",
"modifier": "private static final",
"original_string": "private static final String DSHIP_COMMAND = \"tunnel\";",
"type": "String",
"var_name": "DSHIP_COMMAND"
},
{
"declarator": "DSHIP_SUBCOMMAND_UPLOAD = \"up... | {
"body": "public static TunnelCommand parse(List<String> optionList, ExecutionContext sessionContext) {\n return null;\n }",
"class_method_signature": "TunnelCommand.parse(List<String> optionList, ExecutionContext sessionContext)",
"constructor": false,
"full_signature": "public static TunnelCommand parse(... | {
"created": null,
"fork": null,
"fork_count": 21,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 47536480,
"size": 16942,
"stargazer_count": 58,
"stars": null,
"updates": null,
"url": "https://github.com/aliyun/aliyun-odps-console"
} |
47536480_74 | {
"fields": [
{
"declarator": "expectEx = ExpectedException.none()",
"modifier": "@Rule\n public",
"original_string": "@Rule\n public ExpectedException expectEx = ExpectedException.none();",
"type": "ExpectedException",
"var_name": "expectEx"
}
],
"file": "odps-console-xflo... | {
"body": "@Test\n public void testCreateOffineAmbiguousModelName() throws ODPSConsoleException, OdpsException {\n ExecutionContext context = ExecutionContext.init();\n String cmd = \"create offlinemodel t_offlinemodel t_offlinemodel2 \" +\n \"-modelPath oss://bucket/dir/?role_arn=xxx&host=yyy \" +\... | {
"fields": [
{
"declarator": "HELP_TAGS = new String[]{\"create\", \"offline\", \"model\", \"offlinemodel\"}",
"modifier": "public static final",
"original_string": "public static final String[] HELP_TAGS = new String[]{\"create\", \"offline\", \"model\", \"offlinemodel\"};",
"type": "Str... | {
"body": "public static CreateOfflineModelCommand parse(String cmd, ExecutionContext ctx)\n throws ODPSConsoleException {\n\n if (cmd == null || ctx == null) {\n return null;\n }\n\n OfflineModelInfo modelInfo = CreateOfflineModelCommand.buildOfflineModelInfo(cmd, PATTERN, ctx);\n\n if (modelIn... | {
"created": null,
"fork": null,
"fork_count": 21,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 47536480,
"size": 16942,
"stargazer_count": 58,
"stars": null,
"updates": null,
"url": "https://github.com/aliyun/aliyun-odps-console"
} |
47536480_106 | {
"fields": [
{
"declarator": "expectEx = ExpectedException.none()",
"modifier": "@Rule\n public",
"original_string": "@Rule\n public ExpectedException expectEx = ExpectedException.none();",
"type": "ExpectedException",
"var_name": "expectEx"
}
],
"file": "odps-console-xflo... | {
"body": "@Test\n public void testCopyOfflineModelOmitProjectName() throws ODPSConsoleException, OdpsException {\n ExecutionContext context = ExecutionContext.init();\n String cmd = \"copy offlinemodel \" +\n \"-src_model model1 \" +\n \"-dest_model model2 \";\n CopyOfflineModelCommand comman... | {
"fields": [
{
"declarator": "HELP_TAGS = new String[]{\"copy\", \"offline\", \"model\", \"offlinemodel\"}",
"modifier": "public static final",
"original_string": "public static final String[] HELP_TAGS = new String[]{\"copy\", \"offline\", \"model\", \"offlinemodel\"};",
"type": "String[... | {
"body": "public static CopyOfflineModelCommand parse(String cmd, ExecutionContext ctx)\n throws ODPSConsoleException {\n\n if (cmd == null || ctx == null) {\n return null;\n }\n\n OfflineModelInfo modelInfo = CopyOfflineModelCommand.buildOfflineModelInfo(cmd, PATTERN, ctx);\n\n if (modelInfo =... | {
"created": null,
"fork": null,
"fork_count": 21,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 47536480,
"size": 16942,
"stargazer_count": 58,
"stars": null,
"updates": null,
"url": "https://github.com/aliyun/aliyun-odps-console"
} |
47536480_110 | {
"fields": [
{
"declarator": "TEST_TABLE_NAME = \"session_history_manager_test\"",
"modifier": "private static final",
"original_string": "private static final String TEST_TABLE_NAME = \"session_history_manager_test\";",
"type": "String",
"var_name": "TEST_TABLE_NAME"
},
{
... | {
"body": "@Test\n public void testListHistory() throws Exception {\n // list session 按session创建的顺序\n ByteArrayOutputStream out = new ByteArrayOutputStream();\n PrintStream s = new PrintStream(out);\n\n PrintStream old = System.err;\n System.setErr(s);\n SessionHistoryManager.showHistory(1000);\n ... | {
"fields": [],
"file": "odps-console-dship/src/main/java/com/aliyun/odps/ship/history/SessionHistoryManager.java",
"identifier": "SessionHistoryManager",
"interfaces": "",
"methods": [
{
"class_method_signature": "SessionHistoryManager.listHistory()",
"constructor": false,
"full_signatu... | {
"body": "private static List<SessionHistory> listHistory() {\n\n //format of session dir is '<root_dir>/sessions/<date>/<session_id>'\n String sp = Util.getSessionBaseDir() + \"/sessions\";\n\n List<SessionHistory> ls = new ArrayList<SessionHistory>();\n File file = new File(sp);\n if (file.exists())... | {
"created": null,
"fork": null,
"fork_count": 21,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 47536480,
"size": 16942,
"stargazer_count": 58,
"stars": null,
"updates": null,
"url": "https://github.com/aliyun/aliyun-odps-console"
} |
47536480_62 | {
"fields": [],
"file": "odps-console-resource/src/test/java/com/aliyun/openservices/odps/console/resource/CreateResourceCommandTest.java",
"identifier": "CreateResourceCommandTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test(expected = ODPSConsoleException.class)\n public void testCreateResourceCommandParserWithParenWithoutAlias() throws ODPSConsoleException {\n ExecutionContext context = ExecutionContext.init();\n String commandText = null;\n AddResourceCommand command;\n\n commandText = \"create resource t... | {
"fields": [
{
"declarator": "HELP_TAGS = new String[]{\"create\", \"add\", \"resource\"}",
"modifier": "public static final",
"original_string": "public static final String[] HELP_TAGS = new String[]{\"create\", \"add\", \"resource\"};",
"type": "String[]",
"var_name": "HELP_TAGS"
... | {
"body": "public static AddResourceCommand parse(String commandString, ExecutionContext sessionContext)\n throws ODPSConsoleException {\n\n String[] tokens = new AntlrObject(commandString).getTokenStringArray();\n\n if (tokens != null && tokens.length >= 2 &&\n tokens[0].toUpperCase().equals(\"CREA... | {
"created": null,
"fork": null,
"fork_count": 21,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 47536480,
"size": 16942,
"stargazer_count": 58,
"stars": null,
"updates": null,
"url": "https://github.com/aliyun/aliyun-odps-console"
} |
47536480_35 | {
"fields": [
{
"declarator": "positives = {\"SHOW TABLES\", \"show tables\", \" show tables \\r\",\n \"show tables in project01_\",\n \"\\n\\r\\t SHow\\tTables in \\r project_01_sdf\\n\\r\\t\"}",
"modifier": "private static"... | {
"body": "@Test\n public void testMatchPublicNegative() {\n for (String cmd : pubNegatives) {\n Assert.assertFalse(ShowTablesCommand.matchPublicCmd(cmd).matches());\n }\n }",
"class_method_signature": "ShowTablesCommandTest.testMatchPublicNegative()",
"constructor": false,
"full_signature": "@Test... | {
"fields": [
{
"declarator": "HELP_TAGS = new String[]{\"show\", \"list\", \"ls\", \"table\", \"tables\"}",
"modifier": "public static final",
"original_string": "public static final String[] HELP_TAGS = new String[]{\"show\", \"list\", \"ls\", \"table\", \"tables\"};",
"type": "String[]"... | {
"body": "static Matcher matchPublicCmd(String cmd) {\n return PUBLIC_PATTERN.matcher(cmd);\n }",
"class_method_signature": "ShowTablesCommand.matchPublicCmd(String cmd)",
"constructor": false,
"full_signature": "static Matcher matchPublicCmd(String cmd)",
"identifier": "matchPublicCmd",
"invocations":... | {
"created": null,
"fork": null,
"fork_count": 21,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 47536480,
"size": 16942,
"stargazer_count": 58,
"stars": null,
"updates": null,
"url": "https://github.com/aliyun/aliyun-odps-console"
} |
47536480_34 | {
"fields": [
{
"declarator": "positives = {\"SHOW TABLES\", \"show tables\", \" show tables \\r\",\n \"show tables in project01_\",\n \"\\n\\r\\t SHow\\tTables in \\r project_01_sdf\\n\\r\\t\"}",
"modifier": "private static"... | {
"body": "@Test\n public void testMatchPublicPositive() {\n for (String cmd : pubPositives) {\n Assert.assertTrue(ShowTablesCommand.matchPublicCmd(cmd).matches());\n }\n }",
"class_method_signature": "ShowTablesCommandTest.testMatchPublicPositive()",
"constructor": false,
"full_signature": "@Test ... | {
"fields": [
{
"declarator": "HELP_TAGS = new String[]{\"show\", \"list\", \"ls\", \"table\", \"tables\"}",
"modifier": "public static final",
"original_string": "public static final String[] HELP_TAGS = new String[]{\"show\", \"list\", \"ls\", \"table\", \"tables\"};",
"type": "String[]"... | {
"body": "static Matcher matchPublicCmd(String cmd) {\n return PUBLIC_PATTERN.matcher(cmd);\n }",
"class_method_signature": "ShowTablesCommand.matchPublicCmd(String cmd)",
"constructor": false,
"full_signature": "static Matcher matchPublicCmd(String cmd)",
"identifier": "matchPublicCmd",
"invocations":... | {
"created": null,
"fork": null,
"fork_count": 21,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 47536480,
"size": 16942,
"stargazer_count": 58,
"stars": null,
"updates": null,
"url": "https://github.com/aliyun/aliyun-odps-console"
} |
47536480_111 | {
"fields": [
{
"declarator": "TEST_TABLE_NAME = \"session_history_manager_test\"",
"modifier": "private static final",
"original_string": "private static final String TEST_TABLE_NAME = \"session_history_manager_test\";",
"type": "String",
"var_name": "TEST_TABLE_NAME"
},
{
... | {
"body": "@Test\n public void testListHistoryStatus() throws Exception {\n\n // list session 按session创建的顺序\n ByteArrayOutputStream out = new ByteArrayOutputStream();\n PrintStream s = new PrintStream(out);\n\n PrintStream old = System.err;\n System.setErr(s);\n SessionHistoryManager.showHistory(10... | {
"fields": [],
"file": "odps-console-dship/src/main/java/com/aliyun/odps/ship/history/SessionHistoryManager.java",
"identifier": "SessionHistoryManager",
"interfaces": "",
"methods": [
{
"class_method_signature": "SessionHistoryManager.listHistory()",
"constructor": false,
"full_signatu... | {
"body": "public static void showHistory(int n) throws FileNotFoundException, IOException {\n\n List<SessionHistory> l = listHistory();\n int size = n > l.size() ? l.size() : n;\n\n for (int i = 0; i < size; i++) {\n\n int idx = l.size() - i - 1;\n Map<String, String> ctx = l.get(idx).loadProperty... | {
"created": null,
"fork": null,
"fork_count": 21,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 47536480,
"size": 16942,
"stargazer_count": 58,
"stars": null,
"updates": null,
"url": "https://github.com/aliyun/aliyun-odps-console"
} |
47536480_63 | {
"fields": [
{
"declarator": "positives =\n {\"LIST FUNCTIONS\", \"list Functions\", \" list functions \\r\",\n \"ls \\n\\r\\t functions\", \"LS FUNCTIONS\", \"\\n\\r\\t List\\tfunctions \\n\\r\\t\",\n \"\\n\\r\\t ls\\tfunctions \\n\\r\\t\"}",
"modifier": "private static",
... | {
"body": "@Test\n public void testMatchNegative() throws OdpsException, ODPSConsoleException {\n ExecutionContext ctx = ExecutionContext.init();\n\n for (String cmd : negatives) {\n //debug\n System.out.println(cmd);\n //debug end\n Assert.assertNull(ListFunctionsCommand.parse(cmd, ctx));\... | {
"fields": [
{
"declarator": "HELP_TAGS =\n new String[]{\"list\", \"ls\", \"show\", \"function\", \"functions\"}",
"modifier": "public static final",
"original_string": "public static final String[]\n HELP_TAGS =\n new String[]{\"list\", \"ls\", \"show\", \"function\", \"functio... | {
"body": "public static ListFunctionsCommand parse(String commandString, ExecutionContext sessionContext)\n throws ODPSConsoleException {\n\n Matcher matcher = PATTERN.matcher(commandString);\n\n if (matcher.matches()) {\n String project = null;\n\n if (4 == matcher.groupCount() && matcher.group(... | {
"created": null,
"fork": null,
"fork_count": 21,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 47536480,
"size": 16942,
"stargazer_count": 58,
"stars": null,
"updates": null,
"url": "https://github.com/aliyun/aliyun-odps-console"
} |
47536480_75 | {
"fields": [
{
"declarator": "expectEx = ExpectedException.none()",
"modifier": "@Rule\n public",
"original_string": "@Rule\n public ExpectedException expectEx = ExpectedException.none();",
"type": "ExpectedException",
"var_name": "expectEx"
}
],
"file": "odps-console-xflo... | {
"body": "@Test\n public void testShowXflowsTooManyParams() throws ODPSConsoleException, OdpsException {\n ExecutionContext context = ExecutionContext.init();\n String cmd = \"show xflows a b\";\n expectEx.expect(ODPSConsoleException.class);\n expectEx.expectMessage(ODPSConsoleConstants.BAD_COMMAND + \"... | {
"fields": [
{
"declarator": "HELP_TAGS =\n new String[]{\"show\", \"xflows\", \"xflow\"}",
"modifier": "public static final",
"original_string": "public static final String[] HELP_TAGS =\n new String[]{\"show\", \"xflows\", \"xflow\"};",
"type": "String[]",
"var_name": "H... | {
"body": "public static ShowXflowsCommand parse(String cmd, ExecutionContext ctx)\n throws ODPSConsoleException {\n\n if (cmd == null || ctx == null) {\n return null;\n }\n Matcher matcher = PATTERN.matcher(cmd);\n\n if (!matcher.matches()) {\n return null;\n }\n\n String input = mat... | {
"created": null,
"fork": null,
"fork_count": 21,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 47536480,
"size": 16942,
"stargazer_count": 58,
"stars": null,
"updates": null,
"url": "https://github.com/aliyun/aliyun-odps-console"
} |
47536480_107 | {
"fields": [
{
"declarator": "expectEx = ExpectedException.none()",
"modifier": "@Rule\n public",
"original_string": "@Rule\n public ExpectedException expectEx = ExpectedException.none();",
"type": "ExpectedException",
"var_name": "expectEx"
}
],
"file": "odps-console-xflo... | {
"body": "@Test\n public void testCopyOfflineModelInvalidCommand() throws ODPSConsoleException, OdpsException {\n ExecutionContext context = ExecutionContext.init();\n String cmd = \"copy offlinemodel dummy \" +\n \"-src_model model1 \" +\n \"-dest_model model2 \";\n CopyOfflineModelCommand c... | {
"fields": [
{
"declarator": "HELP_TAGS = new String[]{\"copy\", \"offline\", \"model\", \"offlinemodel\"}",
"modifier": "public static final",
"original_string": "public static final String[] HELP_TAGS = new String[]{\"copy\", \"offline\", \"model\", \"offlinemodel\"};",
"type": "String[... | {
"body": "public static CopyOfflineModelCommand parse(String cmd, ExecutionContext ctx)\n throws ODPSConsoleException {\n\n if (cmd == null || ctx == null) {\n return null;\n }\n\n OfflineModelInfo modelInfo = CopyOfflineModelCommand.buildOfflineModelInfo(cmd, PATTERN, ctx);\n\n if (modelInfo =... | {
"created": null,
"fork": null,
"fork_count": 21,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 47536480,
"size": 16942,
"stargazer_count": 58,
"stars": null,
"updates": null,
"url": "https://github.com/aliyun/aliyun-odps-console"
} |
47536480_22 | {
"fields": [
{
"declarator": "statusCount = 0",
"modifier": "static",
"original_string": "static int statusCount = 0;",
"type": "int",
"var_name": "statusCount"
},
{
"declarator": "progressCount = 0",
"modifier": "static",
"original_string": "static int pro... | {
"body": "@Test\n public void testInstanceRunning_GetProgressFail() throws Exception {\n ExecutionContext context = ExecutionContext.init();\n Odps odps = Mockito.spy(OdpsConnectionFactory.createOdps(context));\n Instances instances = Mockito.spy(odps.instances());\n\n SQLTask task = new SQLTask();\n ... | {
"fields": [
{
"declarator": "STATUS_QUERY_TIMEOUT = TimeUnit.MINUTES.toMillis(5)",
"modifier": "private static final",
"original_string": "private static final long STATUS_QUERY_TIMEOUT = TimeUnit.MINUTES.toMillis(5);",
"type": "long",
"var_name": "STATUS_QUERY_TIMEOUT"
},
... | {
"body": "@Override\n public State run(InstanceStateContext context) throws OdpsException {\n try {\n reporter = new ReporterThread(context);\n reporter.setDaemon(true);\n reporter.start();\n } catch (Exception e) {\n // ignore\n }\n\n // refine ctrl-c signal when interactive mode\n ... | {
"created": null,
"fork": null,
"fork_count": 21,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 47536480,
"size": 16942,
"stargazer_count": 58,
"stars": null,
"updates": null,
"url": "https://github.com/aliyun/aliyun-odps-console"
} |
47536480_59 | {
"fields": [],
"file": "odps-console-resource/src/test/java/com/aliyun/openservices/odps/console/resource/CreateResourceCommandTest.java",
"identifier": "CreateResourceCommandTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test(expected = ODPSConsoleException.class)\n public void testCreateResourceCommandParserWithException() throws ODPSConsoleException {\n ExecutionContext context = ExecutionContext.init();\n String commandText = null;\n AddResourceCommand command;\n\n commandText = \"create resource file -wro... | {
"fields": [
{
"declarator": "HELP_TAGS = new String[]{\"create\", \"add\", \"resource\"}",
"modifier": "public static final",
"original_string": "public static final String[] HELP_TAGS = new String[]{\"create\", \"add\", \"resource\"};",
"type": "String[]",
"var_name": "HELP_TAGS"
... | {
"body": "public static AddResourceCommand parse(String commandString, ExecutionContext sessionContext)\n throws ODPSConsoleException {\n\n String[] tokens = new AntlrObject(commandString).getTokenStringArray();\n\n if (tokens != null && tokens.length >= 2 &&\n tokens[0].toUpperCase().equals(\"CREA... | {
"created": null,
"fork": null,
"fork_count": 21,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 47536480,
"size": 16942,
"stargazer_count": 58,
"stars": null,
"updates": null,
"url": "https://github.com/aliyun/aliyun-odps-console"
} |
47536480_18 | {
"fields": [
{
"declarator": "commandString1 = \"command_test2:100,command_test1:3000,command_test5:-100,command_test3:0,command_test4:-1\"",
"modifier": "public",
"original_string": "public String commandString1 = \"command_test2:100,command_test1:3000,command_test5:-100,command_test3:0,comman... | {
"body": "@Test\n public void boundAndDefalutTest() throws Exception {\n List<PluginPriorityCommand> commandList = new ArrayList<PluginPriorityCommand>();\n\n PluginUtil.getPriorityCommandFromString(commandList, commandString2);\n Collections.sort(commandList);\n\n int i = 0;\n Assert.assertEquals(\"... | {
"fields": [],
"file": "odps-console-basic/src/main/java/com/aliyun/openservices/odps/console/utils/PluginUtil.java",
"identifier": "PluginUtil",
"interfaces": "",
"methods": [
{
"class_method_signature": "PluginUtil.getRootPath()",
"constructor": false,
"full_signature": "public static... | {
"body": "public static void getPriorityCommandFromString(List<PluginPriorityCommand> commands,\n String commandString) throws Exception {\n try {\n if (commandString != null) {\n String[] parts = commandString.split(\",\");\n for (String cmd : p... | {
"created": null,
"fork": null,
"fork_count": 21,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 47536480,
"size": 16942,
"stargazer_count": 58,
"stars": null,
"updates": null,
"url": "https://github.com/aliyun/aliyun-odps-console"
} |
47536480_0 | {
"fields": [],
"file": "odps-console-sql/src/test/java/com/aliyun/openservices/odps/console/SQLCostCommandTest.java",
"identifier": "SQLCostCommandTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testSQLCostCommand() throws ODPSConsoleException, OdpsException {\n ExecutionContext context = ExecutionContext.init();\n String cmd = \"COST SQL select count(key) from src;\";\n SQLCostCommand command = SQLCostCommand.parse(cmd, context);\n assertNotNull(command);\n com... | {
"fields": [
{
"declarator": "HELP_TAGS = new String[]{\"cost\", \"sql\"}",
"modifier": "public static final",
"original_string": "public static final String[] HELP_TAGS = new String[]{\"cost\", \"sql\"};",
"type": "String[]",
"var_name": "HELP_TAGS"
},
{
"declarator":... | {
"body": "public SQLCostCommand(String commandText, ExecutionContext context) {\n super(commandText, context);\n }",
"class_method_signature": "SQLCostCommand.SQLCostCommand(String commandText, ExecutionContext context)",
"constructor": true,
"full_signature": "public SQLCostCommand(String commandText, Ex... | {
"created": null,
"fork": null,
"fork_count": 21,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 47536480,
"size": 16942,
"stargazer_count": 58,
"stars": null,
"updates": null,
"url": "https://github.com/aliyun/aliyun-odps-console"
} |
47536480_38 | {
"fields": [
{
"declarator": "positives = {\"SHOW TABLES\", \"show tables\", \" show tables \\r\",\n \"show tables in project01_\",\n \"\\n\\r\\t SHow\\tTables in \\r project_01_sdf\\n\\r\\t\"}",
"modifier": "private static"... | {
"body": "@Test\n public void testPrefixNegatives() throws ODPSConsoleException {\n ExecutionContext context = ExecutionContext.init();\n\n for (String cmd : prefixMatchNegatives) {\n for (String prefix : prefixNegatives) {\n String cmdStr = String.format(cmd, prefix);\n ShowTablesCommand c... | {
"fields": [
{
"declarator": "HELP_TAGS = new String[]{\"show\", \"list\", \"ls\", \"table\", \"tables\"}",
"modifier": "public static final",
"original_string": "public static final String[] HELP_TAGS = new String[]{\"show\", \"list\", \"ls\", \"table\", \"tables\"};",
"type": "String[]"... | {
"body": "public static ShowTablesCommand parse(String cmd, ExecutionContext cxt)\n throws ODPSConsoleException {\n if (cmd == null || cxt == null) {\n return null;\n }\n\n String projectName = null;\n String prefixName = null;\n Matcher matcher = matchInternalCmd(cmd);\n\n if (matcher.ma... | {
"created": null,
"fork": null,
"fork_count": 21,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 47536480,
"size": 16942,
"stargazer_count": 58,
"stars": null,
"updates": null,
"url": "https://github.com/aliyun/aliyun-odps-console"
} |
47536480_80 | {
"fields": [
{
"declarator": "expectEx = ExpectedException.none()",
"modifier": "@Rule\n public",
"original_string": "@Rule\n public ExpectedException expectEx = ExpectedException.none();",
"type": "ExpectedException",
"var_name": "expectEx"
}
],
"file": "odps-console-xflo... | {
"body": "@Test\n public void testReadOffLineModelWithAsStatementError() throws ODPSConsoleException, OdpsException {\n ExecutionContext context = ExecutionContext.init();\n String cmd = \"read offlinemodel model as_error volume\";\n expectEx.expect(ODPSConsoleException.class);\n expectEx.expectMessage(... | {
"fields": [
{
"declarator": "HELP_TAGS = new String[]{\"read\", \"offline\", \"model\", \"offlinemodel\"}",
"modifier": "public static final",
"original_string": "public static final String[] HELP_TAGS = new String[]{\"read\", \"offline\", \"model\", \"offlinemodel\"};",
"type": "String[... | {
"body": "public static ReadOfflineModelCommand parse(String cmd, ExecutionContext ctx)\n throws ODPSConsoleException {\n\n if (cmd == null || ctx == null) {\n return null;\n }\n\n Matcher m = PATTERN.matcher(cmd);\n if (!m.matches()) {\n return null;\n }\n\n String input = m.group(1... | {
"created": null,
"fork": null,
"fork_count": 21,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 47536480,
"size": 16942,
"stargazer_count": 58,
"stars": null,
"updates": null,
"url": "https://github.com/aliyun/aliyun-odps-console"
} |
47536480_79 | {
"fields": [
{
"declarator": "expectEx = ExpectedException.none()",
"modifier": "@Rule\n public",
"original_string": "@Rule\n public ExpectedException expectEx = ExpectedException.none();",
"type": "ExpectedException",
"var_name": "expectEx"
}
],
"file": "odps-console-xflo... | {
"body": "@Test\n public void testReadOffLineModelInvalidModelName() throws ODPSConsoleException, OdpsException {\n ExecutionContext context = ExecutionContext.init();\n String cmd = \"read offlinemodel model-error\";\n expectEx.expect(ODPSConsoleException.class);\n expectEx.expectMessage(ODPSConsoleCon... | {
"fields": [
{
"declarator": "HELP_TAGS = new String[]{\"read\", \"offline\", \"model\", \"offlinemodel\"}",
"modifier": "public static final",
"original_string": "public static final String[] HELP_TAGS = new String[]{\"read\", \"offline\", \"model\", \"offlinemodel\"};",
"type": "String[... | {
"body": "public static ReadOfflineModelCommand parse(String cmd, ExecutionContext ctx)\n throws ODPSConsoleException {\n\n if (cmd == null || ctx == null) {\n return null;\n }\n\n Matcher m = PATTERN.matcher(cmd);\n if (!m.matches()) {\n return null;\n }\n\n String input = m.group(1... | {
"created": null,
"fork": null,
"fork_count": 21,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 47536480,
"size": 16942,
"stargazer_count": 58,
"stars": null,
"updates": null,
"url": "https://github.com/aliyun/aliyun-odps-console"
} |
47536480_96 | {
"fields": [
{
"declarator": "expectEx = ExpectedException.none()",
"modifier": "@Rule\n public",
"original_string": "@Rule\n public ExpectedException expectEx = ExpectedException.none();",
"type": "ExpectedException",
"var_name": "expectEx"
}
],
"file": "odps-console-xflo... | {
"body": "@Test\n public void testCreateOnLineModelWith3rdModel() throws ODPSConsoleException, OdpsException {\n ExecutionContext context = ExecutionContext.init();\n String cmd = \"create onlinemodel t_3rd_cpp \" +\n \"-target abc \" +\n \"-id SampleProcessor \" +\n \"-libNam... | {
"fields": [
{
"declarator": "HELP_TAGS = new String[]{\"create\", \"model\", \"onlinemodel\", \"online\"}",
"modifier": "public static final",
"original_string": "public static final String[] HELP_TAGS = new String[]{\"create\", \"model\", \"onlinemodel\", \"online\"};",
"type": "String[... | {
"body": "public static CreateOnlineModelCommand parse(String cmd, ExecutionContext ctx)\n throws ODPSConsoleException {\n\n if (cmd == null || ctx == null) {\n return null;\n }\n\n OnlineModelInfo modelInfo = CreateOnlineModelCommand.buildOnlineModelInfo(cmd, PATTERN, ctx);\n if (modelInfo == ... | {
"created": null,
"fork": null,
"fork_count": 21,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 47536480,
"size": 16942,
"stargazer_count": 58,
"stars": null,
"updates": null,
"url": "https://github.com/aliyun/aliyun-odps-console"
} |
47536480_55 | {
"fields": [
{
"declarator": "VOLUME_NAME = \"test_volume\"",
"modifier": "public static",
"original_string": "public static String VOLUME_NAME = \"test_volume\";",
"type": "String",
"var_name": "VOLUME_NAME"
},
{
"declarator": "odps",
"modifier": "private static... | {
"body": "@Test\n public void testAddVolumeArchiveExecute() throws ODPSConsoleException, OdpsException, IOException {\n ExecutionContext context = ExecutionContext.init();\n String commandText = null;\n AbstractCommand command;\n\n Odps odps = OdpsConnectionFactory.createOdps(context);\n\n if (odps.r... | {
"fields": [
{
"declarator": "HELP_TAGS = new String[]{\"add\", \"create\", \"resource\"}",
"modifier": "public static final",
"original_string": "public static final String[] HELP_TAGS = new String[]{\"add\", \"create\", \"resource\"};",
"type": "String[]",
"var_name": "HELP_TAGS"
... | {
"body": "public static AddResourceCommand parse(String commandString, ExecutionContext sessionContext)\n throws ODPSConsoleException {\n\n /*\n * !HACK: filter ADD <object type> <object name> TO PACKAGE <package name>\n * [WITH PRIVILEGES privileges];\n */\n if (isSecurityCommand(commandStrin... | {
"created": null,
"fork": null,
"fork_count": 21,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 47536480,
"size": 16942,
"stargazer_count": 58,
"stars": null,
"updates": null,
"url": "https://github.com/aliyun/aliyun-odps-console"
} |
47536480_127 | {
"fields": [
{
"declarator": "TABLE = \"partition_helper_test\"",
"modifier": "static",
"original_string": "static String TABLE = \"partition_helper_test\";",
"type": "String",
"var_name": "TABLE"
},
{
"declarator": "RED_SQUARE = \"color='red',shape='square'\"",
... | {
"body": "@Test\n public void testBuildSuffix() throws Exception {\n PartitionSpec ps = new PartitionSpec(\"color='red',shape='square',age=12\");\n assertEquals(\".red.square.12\", PartitionHelper.buildSuffix(ps));\n\n ps = new PartitionSpec(\"color='red'\");\n assertEquals(\".red\", PartitionHelper.bui... | {
"fields": [
{
"declarator": "table",
"modifier": "private",
"original_string": "private Table table;",
"type": "Table",
"var_name": "table"
},
{
"declarator": "isPartitioned",
"modifier": "private",
"original_string": "private boolean isPartitioned;",
... | {
"body": "public static String buildSuffix(PartitionSpec ps) {\n if (ps == null) {\n return \"\";\n }\n\n String path = \"\";\n ps.keys().size();\n for (String key : ps.keys()) {\n String val = ps.get(key);\n val = val.replace(':', ';');\n val = val.replace('.', ',');\n path +... | {
"created": null,
"fork": null,
"fork_count": 21,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 47536480,
"size": 16942,
"stargazer_count": 58,
"stars": null,
"updates": null,
"url": "https://github.com/aliyun/aliyun-odps-console"
} |
47536480_14 | {
"fields": [],
"file": "odps-console-basic/src/test/java/com/aliyun/openservices/odps/console/utils/ODPSConsoleUtilsTest.java",
"identifier": "ODPSConsoleUtilsTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testTranslateCommandline() throws ODPSConsoleException {\n String line = \"ABC \\n \\\"abc def\\\" 'd\\ne' \\t\\r\\n fge\";\n String[] st = ODPSConsoleUtils.translateCommandline(line);\n assertEquals(st[0], \"ABC\");\n assertEquals(st[1], \"\\\"abc def\\\"\");\n assertEq... | {
"fields": [
{
"declarator": "DATE_FORMAT = new SimpleDateFormat(\"yyyy-MM-dd HH:mm:ss\", Locale.getDefault())",
"modifier": "public static final",
"original_string": "public static final SimpleDateFormat DATE_FORMAT = new SimpleDateFormat(\"yyyy-MM-dd HH:mm:ss\", Locale.getDefault());",
... | {
"body": "public static String[] translateCommandline(String line) throws ODPSConsoleException {\n if (StringUtils.isNullOrEmpty(line)) {\n return new String[0];\n }\n // parse with a simple finite state machine\n\n final int normal = 0;\n final int inQuote = 1;\n final int inDoubleQuote = 2;\... | {
"created": null,
"fork": null,
"fork_count": 21,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 47536480,
"size": 16942,
"stargazer_count": 58,
"stars": null,
"updates": null,
"url": "https://github.com/aliyun/aliyun-odps-console"
} |
47536480_131 | {
"fields": [
{
"declarator": "TEST_TABLE_NAME = \"file_downloader_test\"",
"modifier": "private static final",
"original_string": "private static final String TEST_TABLE_NAME = \"file_downloader_test\";",
"type": "String",
"var_name": "TEST_TABLE_NAME"
},
{
"declarator... | {
"body": "@Test\n public void testDownloadFileWithCrash4_Success() throws Exception {\n\n String[] args =\n new String[] {\"download\", projectName + \".\" + TEST_TABLE_NAME + \"/ds='2113',pt='pttest'\",\n \"src/test/resources/file/filedownloader/tmp.txt\", \"-fd=||\", \"-rd=\\n\",\n ... | {
"fields": [
{
"declarator": "path",
"modifier": "private final",
"original_string": "private final String path;",
"type": "String",
"var_name": "path"
},
{
"declarator": "start",
"modifier": "private final",
"original_string": "private final Long start;",
... | {
"body": "public void download() throws IOException, TunnelException {\n if (sh != null) {\n String msg = String.format(\"file [\" + id + \"] start\");\n sh.log(msg);\n System.err.println(sim.format(new Date()) + \" - \" + msg);\n }\n\n String fd = DshipContext.INSTANCE.get(Constants.FIELD_... | {
"created": null,
"fork": null,
"fork_count": 21,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 47536480,
"size": 16942,
"stargazer_count": 58,
"stars": null,
"updates": null,
"url": "https://github.com/aliyun/aliyun-odps-console"
} |
47536480_43 | {
"fields": [
{
"declarator": "positive =\n {\"top instance \", \"toP instance \", \"TOP INSTANCE \", \"top instance -d\", \"top instance -d 10\",\n \"top instance -limit 2\", \"top instance -all\", \"top instance -p tt\",\n \"top instance -status running\",\n \"top instance -d -all -... | {
"body": "@Test\n\n public void testSyncPositive() throws ODPSConsoleException, OdpsException {\n ExecutionContext ctx = ExecutionContext.init();\n\n for (String str : positive) {\n TopInstanceCommand test = TopInstanceCommand.parse(str, ctx);\n\n assertNotNull(test);\n }\n }",
"class_method_s... | {
"fields": [
{
"declarator": "HELP_TAGS = new String[]{\"top\", \"instance\"}",
"modifier": "public static final",
"original_string": "public static final String[] HELP_TAGS = new String[]{\"top\", \"instance\"};",
"type": "String[]",
"var_name": "HELP_TAGS"
},
{
"decl... | {
"body": "public static TopInstanceCommand parse(String commandString, ExecutionContext sessionContext)\n throws ODPSConsoleException {\n Matcher matcher = PATTERN.matcher(commandString);\n String projectName = null;\n Integer delay = null;\n Boolean onlyOwner = null;\n Integer number = null;\n ... | {
"created": null,
"fork": null,
"fork_count": 21,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 47536480,
"size": 16942,
"stargazer_count": 58,
"stars": null,
"updates": null,
"url": "https://github.com/aliyun/aliyun-odps-console"
} |
47536480_83 | {
"fields": [
{
"declarator": "expectEx = ExpectedException.none()",
"modifier": "@Rule\n public",
"original_string": "@Rule\n public ExpectedException expectEx = ExpectedException.none();",
"type": "ExpectedException",
"var_name": "expectEx"
}
],
"file": "odps-console-xflo... | {
"body": "@Test\n public void testDescribeOffLineModelConflictPrjName() throws ODPSConsoleException, OdpsException {\n ExecutionContext context = ExecutionContext.init();\n String cmd = \"desc offlinemodel -p prj1 prj2.model\";\n expectEx.expect(ODPSConsoleException.class);\n expectEx.expectMessage(ODPS... | {
"fields": [
{
"declarator": "HELP_TAGS =\n new String[]{\"describe\", \"desc\", \"offline\", \"model\", \"offlinemodel\"}",
"modifier": "public static final",
"original_string": "public static final String[]\n HELP_TAGS =\n new String[]{\"describe\", \"desc\", \"offline\", \"mod... | {
"body": "public static DescribeOfflineModelCommand parse(String cmd, ExecutionContext ctx)\n throws ODPSConsoleException {\n\n if (cmd == null || ctx == null) {\n return null;\n }\n\n Matcher m = PATTERN.matcher(cmd);\n boolean match = m.matches();\n\n if (!match) {\n return null;\n ... | {
"created": null,
"fork": null,
"fork_count": 21,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 47536480,
"size": 16942,
"stargazer_count": 58,
"stars": null,
"updates": null,
"url": "https://github.com/aliyun/aliyun-odps-console"
} |
47536480_95 | {
"fields": [
{
"declarator": "expectEx = ExpectedException.none()",
"modifier": "@Rule\n public",
"original_string": "@Rule\n public ExpectedException expectEx = ExpectedException.none();",
"type": "ExpectedException",
"var_name": "expectEx"
}
],
"file": "odps-console-xflo... | {
"body": "@Test\n public void testCreateOnLineModelWithOfflineModel() throws ODPSConsoleException, OdpsException {\n ExecutionContext context = ExecutionContext.init();\n String cmd = \"create onlinemodel t_offlinemodel \" +\n \"-offlinemodelProject online_model_test \" +\n \"-offlinemod... | {
"fields": [
{
"declarator": "HELP_TAGS = new String[]{\"create\", \"model\", \"onlinemodel\", \"online\"}",
"modifier": "public static final",
"original_string": "public static final String[] HELP_TAGS = new String[]{\"create\", \"model\", \"onlinemodel\", \"online\"};",
"type": "String[... | {
"body": "public static CreateOnlineModelCommand parse(String cmd, ExecutionContext ctx)\n throws ODPSConsoleException {\n\n if (cmd == null || ctx == null) {\n return null;\n }\n\n OnlineModelInfo modelInfo = CreateOnlineModelCommand.buildOnlineModelInfo(cmd, PATTERN, ctx);\n if (modelInfo == ... | {
"created": null,
"fork": null,
"fork_count": 21,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 47536480,
"size": 16942,
"stargazer_count": 58,
"stars": null,
"updates": null,
"url": "https://github.com/aliyun/aliyun-odps-console"
} |
47536480_108 | {
"fields": [],
"file": "odps-console-cupid-public/src/test/java/com/aliyun/openservices/odps/console/cupid/DescribeCupidInstanceCommandTest.java",
"identifier": "DescribeCupidInstanceCommandTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testParse() {\n ExecutionContext cxt = new ExecutionContext();\n\n /**\n * 测试是否接受该命令\n */\n //negative, 可能发生歧义的命令\n String[] cmds = {\"describe instance\", \"desc resource\",\n \"desc onlinemodel\", \"desc project\", \"desc shard\"};\n Describ... | {
"fields": [
{
"declarator": "instanceID",
"modifier": "private",
"original_string": "private String instanceID;",
"type": "String",
"var_name": "instanceID"
},
{
"declarator": "HELP_TAGS = new String[]{\"cupid\", \"desc\", \"describe\"}",
"modifier": "public sta... | {
"body": "public static DescribeCupidInstanceCommand parse(String cmd, ExecutionContext cxt)\n throws ODPSConsoleException {\n\n String regstr = \"\\\\s*(describe|desc)\\\\s+(?:cupid)\\\\s+instance([\\\\s\\\\S]*)\";\n Pattern pattern = Pattern.compile(regstr, Pattern.CASE_INSENSITIVE);\n Matcher matche... | {
"created": null,
"fork": null,
"fork_count": 21,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 47536480,
"size": 16942,
"stargazer_count": 58,
"stars": null,
"updates": null,
"url": "https://github.com/aliyun/aliyun-odps-console"
} |
47536480_124 | {
"fields": [],
"file": "odps-console-dship/src/test/java/com/aliyun/odps/ship/common/UtilTest.java",
"identifier": "UtilTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testGetSessionDir() {\n String path = Util.getSessionBaseDir();\n\n //in ut, root dir is src/test/resources/file\n assertEquals(\"null\", path + \"/sessions/null/null\", Util.getSessionDir(null));\n assertEquals(\"abc\",\n path + \"/sessions/abc/abc\", Util.... | {
"fields": [],
"file": "odps-console-dship/src/main/java/com/aliyun/odps/ship/common/Util.java",
"identifier": "Util",
"interfaces": "",
"methods": [
{
"class_method_signature": "Util.getRootDir()",
"constructor": false,
"full_signature": "private static String getRootDir()",
"ide... | {
"body": "public static String getSessionDir(String sid) throws IllegalArgumentException {\n String subdir;\n if (sid == null) {\n subdir = null;\n } else if (sid.length() > 8) {\n try {\n DateFormat format = new SimpleDateFormat(\"yyyyMMdd\");\n format.parse(sid.substring(0, 8));\n ... | {
"created": null,
"fork": null,
"fork_count": 21,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 47536480,
"size": 16942,
"stargazer_count": 58,
"stars": null,
"updates": null,
"url": "https://github.com/aliyun/aliyun-odps-console"
} |
47536480_56 | {
"fields": [
{
"declarator": "positives =\n {\"LIST RESOURCES\", \"list Resources\", \" list resources \\r\",\n \"ls resources\", \"LS RESOURCES\", \"ls resources -l\",\n \"\\n\\r\\t List\\tresources \\n\\r\\t\", \"\\n\\r\\t ls\\tresources \\n\\r\\t\"}",
"modifier": "private stat... | {
"body": "@Test\n public void testMatchNegative() throws OdpsException, ODPSConsoleException {\n ExecutionContext ctx = ExecutionContext.init();\n ListResourcesCommand test;\n\n for (String cmd : negatives) {\n Assert.assertNull(ListResourcesCommand.parse(cmd, ctx));\n }\n }",
"class_method_sign... | {
"fields": [
{
"declarator": "HELP_TAGS =\n new String[]{\"list\", \"ls\", \"show\", \"resource\", \"resources\"}",
"modifier": "public static final",
"original_string": "public static final String[]\n HELP_TAGS =\n new String[]{\"list\", \"ls\", \"show\", \"resource\", \"resourc... | {
"body": "public static ListResourcesCommand parse(String commandString, ExecutionContext sessionContext)\n throws ODPSConsoleException {\n\n Matcher match = PATTERN.matcher(commandString);\n\n if (match.matches()) {\n Options opts = initOptions();\n CommandLine cl = CommandParserUtils.getComman... | {
"created": null,
"fork": null,
"fork_count": 21,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 47536480,
"size": 16942,
"stargazer_count": 58,
"stars": null,
"updates": null,
"url": "https://github.com/aliyun/aliyun-odps-console"
} |
47536480_17 | {
"fields": [
{
"declarator": "commandString1 = \"command_test2:100,command_test1:3000,command_test5:-100,command_test3:0,command_test4:-1\"",
"modifier": "public",
"original_string": "public String commandString1 = \"command_test2:100,command_test1:3000,command_test5:-100,command_test3:0,comman... | {
"body": "@Test\n public void normalTest() throws Exception {\n List<PluginPriorityCommand> commandList = new ArrayList<PluginPriorityCommand>();\n\n PluginUtil.getPriorityCommandFromString(commandList, commandString1);\n Collections.sort(commandList);\n\n int i = 0;\n for (PluginPriorityCommand comm... | {
"fields": [],
"file": "odps-console-basic/src/main/java/com/aliyun/openservices/odps/console/utils/PluginUtil.java",
"identifier": "PluginUtil",
"interfaces": "",
"methods": [
{
"class_method_signature": "PluginUtil.getRootPath()",
"constructor": false,
"full_signature": "public static... | {
"body": "public static void getPriorityCommandFromString(List<PluginPriorityCommand> commands,\n String commandString) throws Exception {\n try {\n if (commandString != null) {\n String[] parts = commandString.split(\",\");\n for (String cmd : p... | {
"created": null,
"fork": null,
"fork_count": 21,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 47536480,
"size": 16942,
"stargazer_count": 58,
"stars": null,
"updates": null,
"url": "https://github.com/aliyun/aliyun-odps-console"
} |
47536480_40 | {
"fields": [
{
"declarator": "positive = {\"kill -sync \", \"kill \", \"KiLl \", \"KILL -sync \"}",
"modifier": "private",
"original_string": "private String[] positive = {\"kill -sync \", \"kill \", \"KiLl \", \"KILL -sync \"};",
"type": "String[]",
"var_name": "positive"
},
... | {
"body": "@Test(expected = ODPSConsoleException.class)\n public void testSyncBadParas() throws ODPSConsoleException, OdpsException {\n ExecutionContext ctx = ExecutionContext.init();\n\n for (String str : badPara) {\n String cmd = str + getID(ctx);\n StopInstanceCommand.parse(cmd, ctx);\n }\n }"... | {
"fields": [
{
"declarator": "HELP_TAGS = new String[]{\"kill\", \"stop\", \"instance\"}",
"modifier": "public static final",
"original_string": "public static final String[] HELP_TAGS = new String[]{\"kill\", \"stop\", \"instance\"};",
"type": "String[]",
"var_name": "HELP_TAGS"
... | {
"body": "public static StopInstanceCommand parse(String commandString, ExecutionContext sessionContext)\n throws ODPSConsoleException {\n if (commandString.toUpperCase().startsWith(\"KILL\")) {\n\n String temp[] = commandString.trim().replaceAll(\"\\\\s+\", \" \").split(\" \");\n\n CommandLine cl ... | {
"created": null,
"fork": null,
"fork_count": 21,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 47536480,
"size": 16942,
"stargazer_count": 58,
"stars": null,
"updates": null,
"url": "https://github.com/aliyun/aliyun-odps-console"
} |
47536480_132 | {
"fields": [
{
"declarator": "TEST_TABLE_NAME = \"file_downloader_test\"",
"modifier": "private static final",
"original_string": "private static final String TEST_TABLE_NAME = \"file_downloader_test\";",
"type": "String",
"var_name": "TEST_TABLE_NAME"
},
{
"declarator... | {
"body": "@Test\n public void testDownloadFileWithCrash5_Fail() throws Exception {\n String[] args =\n new String[] {\"download\", projectName + \".\" + TEST_TABLE_NAME + \"/ds='2113',pt='pttest'\",\n \"src/test/resources/file/filedownloader/tmp.txt\", \"-fd=||\", \"-rd=\\n\",\n \"-d... | {
"fields": [
{
"declarator": "path",
"modifier": "private final",
"original_string": "private final String path;",
"type": "String",
"var_name": "path"
},
{
"declarator": "start",
"modifier": "private final",
"original_string": "private final Long start;",
... | {
"body": "public void download() throws IOException, TunnelException {\n if (sh != null) {\n String msg = String.format(\"file [\" + id + \"] start\");\n sh.log(msg);\n System.err.println(sim.format(new Date()) + \" - \" + msg);\n }\n\n String fd = DshipContext.INSTANCE.get(Constants.FIELD_... | {
"created": null,
"fork": null,
"fork_count": 21,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 47536480,
"size": 16942,
"stargazer_count": 58,
"stars": null,
"updates": null,
"url": "https://github.com/aliyun/aliyun-odps-console"
} |
47536480_37 | {
"fields": [
{
"declarator": "positives = {\"SHOW TABLES\", \"show tables\", \" show tables \\r\",\n \"show tables in project01_\",\n \"\\n\\r\\t SHow\\tTables in \\r project_01_sdf\\n\\r\\t\"}",
"modifier": "private static"... | {
"body": "@Test\n public void testInvalidParams() throws ODPSConsoleException, OdpsException {\n ExecutionContext context = ExecutionContext.init();\n\n for (String cmd : pubInvalidPara) {\n try {\n ShowTablesCommand command = ShowTablesCommand.parse(cmd, context);\n Assert.assertNotNull(nu... | {
"fields": [
{
"declarator": "HELP_TAGS = new String[]{\"show\", \"list\", \"ls\", \"table\", \"tables\"}",
"modifier": "public static final",
"original_string": "public static final String[] HELP_TAGS = new String[]{\"show\", \"list\", \"ls\", \"table\", \"tables\"};",
"type": "String[]"... | {
"body": "public static ShowTablesCommand parse(String cmd, ExecutionContext cxt)\n throws ODPSConsoleException {\n if (cmd == null || cxt == null) {\n return null;\n }\n\n String projectName = null;\n String prefixName = null;\n Matcher matcher = matchInternalCmd(cmd);\n\n if (matcher.ma... | {
"created": null,
"fork": null,
"fork_count": 21,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 47536480,
"size": 16942,
"stargazer_count": 58,
"stars": null,
"updates": null,
"url": "https://github.com/aliyun/aliyun-odps-console"
} |
47536480_60 | {
"fields": [],
"file": "odps-console-resource/src/test/java/com/aliyun/openservices/odps/console/resource/CreateResourceCommandTest.java",
"identifier": "CreateResourceCommandTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test(expected = ODPSConsoleException.class)\n public void testCreateResourceCommandParserWithException2() throws ODPSConsoleException {\n ExecutionContext context = ExecutionContext.init();\n String commandText = null;\n AddResourceCommand command;\n\n commandText = \"create resource file aaa... | {
"fields": [
{
"declarator": "HELP_TAGS = new String[]{\"create\", \"add\", \"resource\"}",
"modifier": "public static final",
"original_string": "public static final String[] HELP_TAGS = new String[]{\"create\", \"add\", \"resource\"};",
"type": "String[]",
"var_name": "HELP_TAGS"
... | {
"body": "public static AddResourceCommand parse(String commandString, ExecutionContext sessionContext)\n throws ODPSConsoleException {\n\n String[] tokens = new AntlrObject(commandString).getTokenStringArray();\n\n if (tokens != null && tokens.length >= 2 &&\n tokens[0].toUpperCase().equals(\"CREA... | {
"created": null,
"fork": null,
"fork_count": 21,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 47536480,
"size": 16942,
"stargazer_count": 58,
"stars": null,
"updates": null,
"url": "https://github.com/aliyun/aliyun-odps-console"
} |
47536480_112 | {
"fields": [
{
"declarator": "originalCharset",
"modifier": "static",
"original_string": "static String originalCharset;",
"type": "String",
"var_name": "originalCharset"
}
],
"file": "odps-console-dship/src/test/java/com/aliyun/odps/ship/upload/BlockRecordReaderTest.java",
... | {
"body": "@Test\n public void testSpliter() throws Exception {\n\n /**\n * file content 123||a测试bc||||234||bbb||||333||ccc|\n * */\n\n BlockInfo blockInfo = new BlockInfo(1L, new File(\"src/test/resources/file/reader/one_char_split_A.txt\"), 0L, 15L);\n BlockRecordReader reader = new BlockRecordRea... | {
"fields": [
{
"declarator": "fieldDelimiter",
"modifier": "private",
"original_string": "private byte[] fieldDelimiter;",
"type": "byte[]",
"var_name": "fieldDelimiter"
},
{
"declarator": "recordDelimiter",
"modifier": "private",
"original_string": "privat... | {
"body": "protected byte[][] splitLine(byte[] sbl) {\n\n if (sbl == null) {\n return null;\n }\n List<byte[]> l = new ArrayList<byte[]>();\n int start = 0;\n int end = 0;\n while (end != -1) {\n end = indexOf(sbl, start, sbl.length, fieldDelimiter);\n int colLen = (end == -1 ? sbl.le... | {
"created": null,
"fork": null,
"fork_count": 21,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 47536480,
"size": 16942,
"stargazer_count": 58,
"stars": null,
"updates": null,
"url": "https://github.com/aliyun/aliyun-odps-console"
} |
47536480_99 | {
"fields": [
{
"declarator": "expectEx = ExpectedException.none()",
"modifier": "@Rule\n public",
"original_string": "@Rule\n public ExpectedException expectEx = ExpectedException.none();",
"type": "ExpectedException",
"var_name": "expectEx"
}
],
"file": "odps-console-xflo... | {
"body": "@Test\n public void testCreateOnLineModelParameterError2() throws ODPSConsoleException, OdpsException {\n ExecutionContext context = ExecutionContext.init();\n String cmd = \"create onlinemodel -p prj1 model1 \" +\n \"-target target1 \" +\n \"-libName lib1 \" +\n \"-... | {
"fields": [
{
"declarator": "HELP_TAGS = new String[]{\"create\", \"model\", \"onlinemodel\", \"online\"}",
"modifier": "public static final",
"original_string": "public static final String[] HELP_TAGS = new String[]{\"create\", \"model\", \"onlinemodel\", \"online\"};",
"type": "String[... | {
"body": "public static CreateOnlineModelCommand parse(String cmd, ExecutionContext ctx)\n throws ODPSConsoleException {\n\n if (cmd == null || ctx == null) {\n return null;\n }\n\n OnlineModelInfo modelInfo = CreateOnlineModelCommand.buildOnlineModelInfo(cmd, PATTERN, ctx);\n if (modelInfo == ... | {
"created": null,
"fork": null,
"fork_count": 21,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 47536480,
"size": 16942,
"stargazer_count": 58,
"stars": null,
"updates": null,
"url": "https://github.com/aliyun/aliyun-odps-console"
} |
47536480_104 | {
"fields": [
{
"declarator": "expectEx = ExpectedException.none()",
"modifier": "@Rule\n public",
"original_string": "@Rule\n public ExpectedException expectEx = ExpectedException.none();",
"type": "ExpectedException",
"var_name": "expectEx"
}
],
"file": "odps-console-xflo... | {
"body": "@Test\n public void testShowOffLineModelsTooManyParams() throws ODPSConsoleException, OdpsException {\n ExecutionContext context = ExecutionContext.init();\n String cmd = \"show offlinemodels a b\";\n expectEx.expect(ODPSConsoleException.class);\n expectEx.expectMessage(ODPSConsoleConstants.BA... | {
"fields": [
{
"declarator": "HELP_TAGS =\n new String[]{\"show\", \"offline\", \"model\", \"offlinemodels\", \"offlinemodel\"}",
"modifier": "public static final",
"original_string": "public static final String[] HELP_TAGS =\n new String[]{\"show\", \"offline\", \"model\", \"offlinem... | {
"body": "public static ShowOfflineModelsCommand parse(String cmd, ExecutionContext ctx)\n throws ODPSConsoleException {\n\n if (cmd == null || ctx == null) {\n return null;\n }\n Matcher matcher = PATTERN.matcher(cmd);\n\n if (!matcher.matches()) {\n return null;\n }\n\n String inpu... | {
"created": null,
"fork": null,
"fork_count": 21,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 47536480,
"size": 16942,
"stargazer_count": 58,
"stars": null,
"updates": null,
"url": "https://github.com/aliyun/aliyun-odps-console"
} |
47536480_76 | {
"fields": [
{
"declarator": "expectEx = ExpectedException.none()",
"modifier": "@Rule\n public",
"original_string": "@Rule\n public ExpectedException expectEx = ExpectedException.none();",
"type": "ExpectedException",
"var_name": "expectEx"
}
],
"file": "odps-console-xflo... | {
"body": "@Test\n public void testReadOffLineModelMatchNone() throws ODPSConsoleException, OdpsException {\n ExecutionContext context = ExecutionContext.init();\n String cmd = \"read offlinemodel\";\n ReadOfflineModelCommand command = ReadOfflineModelCommand.parse(cmd, context);\n assertNull(command);\n... | {
"fields": [
{
"declarator": "HELP_TAGS = new String[]{\"read\", \"offline\", \"model\", \"offlinemodel\"}",
"modifier": "public static final",
"original_string": "public static final String[] HELP_TAGS = new String[]{\"read\", \"offline\", \"model\", \"offlinemodel\"};",
"type": "String[... | {
"body": "public static ReadOfflineModelCommand parse(String cmd, ExecutionContext ctx)\n throws ODPSConsoleException {\n\n if (cmd == null || ctx == null) {\n return null;\n }\n\n Matcher m = PATTERN.matcher(cmd);\n if (!m.matches()) {\n return null;\n }\n\n String input = m.group(1... | {
"created": null,
"fork": null,
"fork_count": 21,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 47536480,
"size": 16942,
"stargazer_count": 58,
"stars": null,
"updates": null,
"url": "https://github.com/aliyun/aliyun-odps-console"
} |
47536480_21 | {
"fields": [
{
"declarator": "showTbaleCommandText = \"show tables;\"",
"modifier": "",
"original_string": "String showTbaleCommandText = \"show tables;\";",
"type": "String",
"var_name": "showTbaleCommandText"
},
{
"declarator": "createTableCommandText = \"create tabl... | {
"body": "@Test\n public void testGetCommandArgs() throws ODPSConsoleException {\n // parse negative\n String negative[][] = {{\"-G\", \"23\"}, {\"-G\"}, {\"23\"}, {\"-I\"}, {\"-i\"}, {\"-I \", \"345\", \"-e\"}, {}};\n for (String[] neg : negative) {\n assertArrayEquals(neg, CommandParserUtils.getComm... | {
"fields": [
{
"declarator": "COMMAND_PACKAGE = \"com.aliyun.openservices.odps.console.commands\"",
"modifier": "private static final",
"original_string": "private static final String COMMAND_PACKAGE = \"com.aliyun.openservices.odps.console.commands\";",
"type": "String",
"var_name"... | {
"body": "public static String[] getCommandArgs(String[] args) throws ODPSConsoleException {\n if (args.length == 2 && args[0].trim().equalsIgnoreCase(\"-I\")) {\n return getArgsFromTempFile(args[1]);\n } else {\n return args;\n }\n }",
"class_method_signature": "CommandParserUtils.getCommandAr... | {
"created": null,
"fork": null,
"fork_count": 21,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 47536480,
"size": 16942,
"stargazer_count": 58,
"stars": null,
"updates": null,
"url": "https://github.com/aliyun/aliyun-odps-console"
} |
47536480_128 | {
"fields": [
{
"declarator": "TABLE = \"partition_helper_test\"",
"modifier": "static",
"original_string": "static String TABLE = \"partition_helper_test\";",
"type": "String",
"var_name": "TABLE"
},
{
"declarator": "RED_SQUARE = \"color='red',shape='square'\"",
... | {
"body": "@Test\n public void testIsPartitioned() throws Exception {\n assertTrue(helper1.isPartitioned());\n assertTrue(helper2.isPartitioned());\n }",
"class_method_signature": "PartitionHelperTest.testIsPartitioned()",
"constructor": false,
"full_signature": "@Test public void testIsPartitioned()",
... | {
"fields": [
{
"declarator": "table",
"modifier": "private",
"original_string": "private Table table;",
"type": "Table",
"var_name": "table"
},
{
"declarator": "isPartitioned",
"modifier": "private",
"original_string": "private boolean isPartitioned;",
... | {
"body": "public boolean isPartitioned() {\n return isPartitioned;\n }",
"class_method_signature": "PartitionHelper.isPartitioned()",
"constructor": false,
"full_signature": "public boolean isPartitioned()",
"identifier": "isPartitioned",
"invocations": [],
"modifiers": "public",
"parameters": "()"... | {
"created": null,
"fork": null,
"fork_count": 21,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 47536480,
"size": 16942,
"stargazer_count": 58,
"stars": null,
"updates": null,
"url": "https://github.com/aliyun/aliyun-odps-console"
} |
47536480_3 | {
"fields": [
{
"declarator": "sessionCMD = {\n \"start session\",\n \"start session public.test\",\n \"start session test\",\n \"stop session\",\n \"stop session instanceid\",\n \"detach session\",\n \"attach session test\",\n \"attach... | {
"body": "@Test\n public void testParse() throws ODPSConsoleException, OdpsException {\n\n for (String cmd : sessionCMD) {\n System.out.println(cmd);\n ExecutionContext context = ExecutionContext.init();\n InteractiveQueryCommand command = InteractiveQueryCommand.parse(cmd, context);\n assert... | {
"fields": [
{
"declarator": "DATE_FORMAT = new SimpleDateFormat(\"yyyy-MM-dd HH:mm:ss\")",
"modifier": "private static",
"original_string": "private static SimpleDateFormat DATE_FORMAT = new SimpleDateFormat(\"yyyy-MM-dd HH:mm:ss\");",
"type": "SimpleDateFormat",
"var_name": "DATE_... | {
"body": "public static InteractiveQueryCommand parse(String commandString, ExecutionContext sessionContext) {\n boolean matched = false;\n /* BEGIN: opensource removal */\n if (commandString.matches(startRegex) ||\n commandString.matches(useRegex)) {\n matched = true;\n sessionContext.setI... | {
"created": null,
"fork": null,
"fork_count": 21,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 47536480,
"size": 16942,
"stargazer_count": 58,
"stars": null,
"updates": null,
"url": "https://github.com/aliyun/aliyun-odps-console"
} |
47536480_2 | {
"fields": [
{
"declarator": "selectCommandStrings = {\"select count(*) from src;\", \"select\\n\\r count(*) \\t from src;\\t\"}",
"modifier": "private",
"original_string": "private String[]\n selectCommandStrings = {\"select count(*) from src;\", \"select\\n\\r count(*) \\t from src;\\t\"... | {
"body": "@Test\n public void testRun() throws ODPSConsoleException, OdpsException {\n ExecutionContext context = ExecutionContext.init();\n\n MockQueryCommand command = new MockQueryCommand(true, selectCommandStrings[0], context);\n command.run();\n\n command = new MockQueryCommand(false, queryCommandS... | {
"fields": [
{
"declarator": "taskName = \"\"",
"modifier": "private",
"original_string": "private String taskName = \"\";",
"type": "String",
"var_name": "taskName"
},
{
"declarator": "isSelectCommand = false",
"modifier": "private",
"original_string": "pr... | {
"body": "public void run() throws OdpsException, ODPSConsoleException {\n if (isSelectCommand && getContext().isAsyncMode()) {\n getWriter().writeError(\"[async mode]: can't support select command.\");\n return;\n }\n\n ExecutionContext context = getContext();\n\n if (context.isInteractiveMode... | {
"created": null,
"fork": null,
"fork_count": 21,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 47536480,
"size": 16942,
"stargazer_count": 58,
"stars": null,
"updates": null,
"url": "https://github.com/aliyun/aliyun-odps-console"
} |
47536480_129 | {
"fields": [
{
"declarator": "TEST_TABLE_NAME = \"file_downloader_test\"",
"modifier": "private static final",
"original_string": "private static final String TEST_TABLE_NAME = \"file_downloader_test\";",
"type": "String",
"var_name": "TEST_TABLE_NAME"
},
{
"declarator... | {
"body": "@Test\n public void testDownloadSlice() throws Exception {\n String[] args =\n new String[]{\"download\", projectName + \".\" + TEST_TABLE_NAME + \"/ds='2113',pt='pttest'\",\n \"src/test/resources/file/filedownloader/tmp.txt\", \"-fd=||\", \"-rd=\\n\",\n ... | {
"fields": [
{
"declarator": "path",
"modifier": "private final",
"original_string": "private final String path;",
"type": "String",
"var_name": "path"
},
{
"declarator": "start",
"modifier": "private final",
"original_string": "private final Long start;",
... | {
"body": "public void download() throws IOException, TunnelException {\n if (sh != null) {\n String msg = String.format(\"file [\" + id + \"] start\");\n sh.log(msg);\n System.err.println(sim.format(new Date()) + \" - \" + msg);\n }\n\n String fd = DshipContext.INSTANCE.get(Constants.FIELD_... | {
"created": null,
"fork": null,
"fork_count": 21,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 47536480,
"size": 16942,
"stargazer_count": 58,
"stars": null,
"updates": null,
"url": "https://github.com/aliyun/aliyun-odps-console"
} |
47536480_20 | {
"fields": [
{
"declarator": "showTbaleCommandText = \"show tables;\"",
"modifier": "",
"original_string": "String showTbaleCommandText = \"show tables;\";",
"type": "String",
"var_name": "showTbaleCommandText"
},
{
"declarator": "createTableCommandText = \"create tabl... | {
"body": "@Test\n public void commandPaserTest() throws ODPSConsoleException {\n ExecutionContext ctx = ExecutionContext.init();\n AbstractCommand command;\n command = CommandParserUtils.parseCommand(showTbaleCommandText, ctx);\n assertTrue(command instanceof CompositeCommand);\n }",
"class_method_si... | {
"fields": [
{
"declarator": "COMMAND_PACKAGE = \"com.aliyun.openservices.odps.console.commands\"",
"modifier": "private static final",
"original_string": "private static final String COMMAND_PACKAGE = \"com.aliyun.openservices.odps.console.commands\";",
"type": "String",
"var_name"... | {
"body": "public static AbstractCommand parseCommand(String commandLines, ExecutionContext sessionContext)\n throws ODPSConsoleException {\n\n commandLines = commandLines.trim();\n if (commandLines.equals(\"\")) {\n throw new ODPSConsoleException(ODPSConsoleConstants.INVALID_PARAMETER_E);\n }\n\n ... | {
"created": null,
"fork": null,
"fork_count": 21,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 47536480,
"size": 16942,
"stargazer_count": 58,
"stars": null,
"updates": null,
"url": "https://github.com/aliyun/aliyun-odps-console"
} |
47536480_98 | {
"fields": [
{
"declarator": "expectEx = ExpectedException.none()",
"modifier": "@Rule\n public",
"original_string": "@Rule\n public ExpectedException expectEx = ExpectedException.none();",
"type": "ExpectedException",
"var_name": "expectEx"
}
],
"file": "odps-console-xflo... | {
"body": "@Test\n public void testCreateOnLineModelParameterError1() throws ODPSConsoleException, OdpsException {\n ExecutionContext context = ExecutionContext.init();\n String cmd = \"create onlinemodel -p prj1 model1 \" +\n \"-qos 5000 \" +\n \"-instanceNum 2 \" +\n \"-cpu 1... | {
"fields": [
{
"declarator": "HELP_TAGS = new String[]{\"create\", \"model\", \"onlinemodel\", \"online\"}",
"modifier": "public static final",
"original_string": "public static final String[] HELP_TAGS = new String[]{\"create\", \"model\", \"onlinemodel\", \"online\"};",
"type": "String[... | {
"body": "public static CreateOnlineModelCommand parse(String cmd, ExecutionContext ctx)\n throws ODPSConsoleException {\n\n if (cmd == null || ctx == null) {\n return null;\n }\n\n OnlineModelInfo modelInfo = CreateOnlineModelCommand.buildOnlineModelInfo(cmd, PATTERN, ctx);\n if (modelInfo == ... | {
"created": null,
"fork": null,
"fork_count": 21,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 47536480,
"size": 16942,
"stargazer_count": 58,
"stars": null,
"updates": null,
"url": "https://github.com/aliyun/aliyun-odps-console"
} |
47536480_105 | {
"fields": [
{
"declarator": "expectEx = ExpectedException.none()",
"modifier": "@Rule\n public",
"original_string": "@Rule\n public ExpectedException expectEx = ExpectedException.none();",
"type": "ExpectedException",
"var_name": "expectEx"
}
],
"file": "odps-console-xflo... | {
"body": "@Test\n public void testCopyOfflineModelBasic() throws ODPSConsoleException, OdpsException {\n ExecutionContext context = ExecutionContext.init();\n String cmd = \"copy offlinemodel \" +\n \"-src_model model1 \" +\n \"-dest_model model2 \" +\n \"-src_project project1... | {
"fields": [
{
"declarator": "HELP_TAGS = new String[]{\"copy\", \"offline\", \"model\", \"offlinemodel\"}",
"modifier": "public static final",
"original_string": "public static final String[] HELP_TAGS = new String[]{\"copy\", \"offline\", \"model\", \"offlinemodel\"};",
"type": "String[... | {
"body": "public static CopyOfflineModelCommand parse(String cmd, ExecutionContext ctx)\n throws ODPSConsoleException {\n\n if (cmd == null || ctx == null) {\n return null;\n }\n\n OfflineModelInfo modelInfo = CopyOfflineModelCommand.buildOfflineModelInfo(cmd, PATTERN, ctx);\n\n if (modelInfo =... | {
"created": null,
"fork": null,
"fork_count": 21,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 47536480,
"size": 16942,
"stargazer_count": 58,
"stars": null,
"updates": null,
"url": "https://github.com/aliyun/aliyun-odps-console"
} |
47536480_77 | {
"fields": [
{
"declarator": "expectEx = ExpectedException.none()",
"modifier": "@Rule\n public",
"original_string": "@Rule\n public ExpectedException expectEx = ExpectedException.none();",
"type": "ExpectedException",
"var_name": "expectEx"
}
],
"file": "odps-console-xflo... | {
"body": "@Test\n public void testReadOffLineModelConflitPrjName() throws ODPSConsoleException, OdpsException {\n ExecutionContext context = ExecutionContext.init();\n String cmd = \"read offlinemodel -p prj1 prj2.model\";\n expectEx.expect(ODPSConsoleException.class);\n expectEx.expectMessage(ODPSConso... | {
"fields": [
{
"declarator": "HELP_TAGS = new String[]{\"read\", \"offline\", \"model\", \"offlinemodel\"}",
"modifier": "public static final",
"original_string": "public static final String[] HELP_TAGS = new String[]{\"read\", \"offline\", \"model\", \"offlinemodel\"};",
"type": "String[... | {
"body": "public static ReadOfflineModelCommand parse(String cmd, ExecutionContext ctx)\n throws ODPSConsoleException {\n\n if (cmd == null || ctx == null) {\n return null;\n }\n\n Matcher m = PATTERN.matcher(cmd);\n if (!m.matches()) {\n return null;\n }\n\n String input = m.group(1... | {
"created": null,
"fork": null,
"fork_count": 21,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 47536480,
"size": 16942,
"stargazer_count": 58,
"stars": null,
"updates": null,
"url": "https://github.com/aliyun/aliyun-odps-console"
} |
47536480_61 | {
"fields": [],
"file": "odps-console-resource/src/test/java/com/aliyun/openservices/odps/console/resource/CreateResourceCommandTest.java",
"identifier": "CreateResourceCommandTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test(expected = ODPSConsoleException.class)\n public void testCreateResourceCommandParserWithParenUnmatched() throws ODPSConsoleException {\n ExecutionContext context = ExecutionContext.init();\n String commandText = null;\n AddResourceCommand command;\n\n commandText = \"create resource tabl... | {
"fields": [
{
"declarator": "HELP_TAGS = new String[]{\"create\", \"add\", \"resource\"}",
"modifier": "public static final",
"original_string": "public static final String[] HELP_TAGS = new String[]{\"create\", \"add\", \"resource\"};",
"type": "String[]",
"var_name": "HELP_TAGS"
... | {
"body": "public static AddResourceCommand parse(String commandString, ExecutionContext sessionContext)\n throws ODPSConsoleException {\n\n String[] tokens = new AntlrObject(commandString).getTokenStringArray();\n\n if (tokens != null && tokens.length >= 2 &&\n tokens[0].toUpperCase().equals(\"CREA... | {
"created": null,
"fork": null,
"fork_count": 21,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 47536480,
"size": 16942,
"stargazer_count": 58,
"stars": null,
"updates": null,
"url": "https://github.com/aliyun/aliyun-odps-console"
} |
47536480_113 | {
"fields": [
{
"declarator": "originalCharset",
"modifier": "static",
"original_string": "static String originalCharset;",
"type": "String",
"var_name": "originalCharset"
}
],
"file": "odps-console-dship/src/test/java/com/aliyun/odps/ship/upload/BlockRecordReaderTest.java",
... | {
"body": "@Test\n public void testReadMultiBlocksNormalCase() throws Exception {\n // block split exactly at line split\n {\n //first block will read 2 line\n BlockInfo blockInfo = new BlockInfo(1L, new File(\"src/test/resources/file/reader/one_char_split.txt\"), 0L, 8L);\n BlockRecordReader re... | {
"fields": [
{
"declarator": "fieldDelimiter",
"modifier": "private",
"original_string": "private byte[] fieldDelimiter;",
"type": "byte[]",
"var_name": "fieldDelimiter"
},
{
"declarator": "recordDelimiter",
"modifier": "private",
"original_string": "privat... | {
"body": "public byte[][] readTextRecord() throws IOException {\n if (isLastLine) {\n return null;\n }\n currentLine = readLine();\n isLastLine = startPos + readBytes > blockInfo.getStartPos() + blockInfo.getLength();\n return splitLine(currentLine);\n }",
"class_method_signature": "BlockRecor... | {
"created": null,
"fork": null,
"fork_count": 21,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 47536480,
"size": 16942,
"stargazer_count": 58,
"stars": null,
"updates": null,
"url": "https://github.com/aliyun/aliyun-odps-console"
} |
47536480_36 | {
"fields": [
{
"declarator": "positives = {\"SHOW TABLES\", \"show tables\", \" show tables \\r\",\n \"show tables in project01_\",\n \"\\n\\r\\t SHow\\tTables in \\r project_01_sdf\\n\\r\\t\"}",
"modifier": "private static"... | {
"body": "@Test\n public void testLackProjectName() throws ODPSConsoleException {\n ExecutionContext context = ExecutionContext.init();\n\n for (String cmd : pubLackPara) {\n try {\n ShowTablesCommand command = ShowTablesCommand.parse(cmd, context);\n Assert.assertNotNull(null);\n } ca... | {
"fields": [
{
"declarator": "HELP_TAGS = new String[]{\"show\", \"list\", \"ls\", \"table\", \"tables\"}",
"modifier": "public static final",
"original_string": "public static final String[] HELP_TAGS = new String[]{\"show\", \"list\", \"ls\", \"table\", \"tables\"};",
"type": "String[]"... | {
"body": "public static ShowTablesCommand parse(String cmd, ExecutionContext cxt)\n throws ODPSConsoleException {\n if (cmd == null || cxt == null) {\n return null;\n }\n\n String projectName = null;\n String prefixName = null;\n Matcher matcher = matchInternalCmd(cmd);\n\n if (matcher.ma... | {
"created": null,
"fork": null,
"fork_count": 21,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 47536480,
"size": 16942,
"stargazer_count": 58,
"stars": null,
"updates": null,
"url": "https://github.com/aliyun/aliyun-odps-console"
} |
47536480_41 | {
"fields": [
{
"declarator": "positives = { \"DESCRIBE project_name.table_name\",\n \"DESC project_name.table_name\", \"desc project_name.table_name\",\n \"\\r\\n\\tDesCribe\\r\\n\\tproject_name.table_name\\r\\t\\n\" }",
"modifier": "private static final",
"original_string": "private ... | {
"body": "@Test\n public void testCommandParse() throws ODPSConsoleException {\n ExecutionContext context = ExecutionContext.init();\n for (String cmd : p_positives) {\n AbstractCommand command = DescribeTableCommand.parse(cmd, context);\n assertNotNull(command);\n assertTrue(command instanceof... | {
"fields": [
{
"declarator": "project",
"modifier": "private",
"original_string": "private String project;",
"type": "String",
"var_name": "project"
},
{
"declarator": "table",
"modifier": "private",
"original_string": "private String table;",
"type":... | {
"body": "public static DescribeTableCommand parse(String cmd, ExecutionContext cxt) {\n if (cmd == null || cxt == null) {\n return null;\n }\n\n DescribeTableCommand r = null;\n Matcher m = PATTERN.matcher(cmd);\n boolean match = m.matches();\n\n if (!match) {\n return r;\n }\n\n c... | {
"created": null,
"fork": null,
"fork_count": 21,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 47536480,
"size": 16942,
"stargazer_count": 58,
"stars": null,
"updates": null,
"url": "https://github.com/aliyun/aliyun-odps-console"
} |
47536480_16 | {
"fields": [],
"file": "odps-console-basic/src/test/java/com/aliyun/openservices/odps/console/utils/FileUtilTest.java",
"identifier": "FileUtilTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testExpandUserHomeInPath() {\n String path = \"~/test_dir/file\";\n\n Assert.assertEquals(System.getProperty(\"user.home\") + \"/test_dir/file\",\n FileUtil.expandUserHomeInPath(path));\n\n path = \"~\";\n Assert.assertEquals(System.getProperty(\"user... | {
"fields": [],
"file": "odps-console-basic/src/main/java/com/aliyun/openservices/odps/console/utils/FileUtil.java",
"identifier": "FileUtil",
"interfaces": "",
"methods": [
{
"class_method_signature": "FileUtil.saveInputStreamToFile(InputStream inputStream, String filePath)",
"constructor": f... | {
"body": "public static String expandUserHomeInPath(String path) {\n if (path.matches(\"^~(/|$).*\")) {\n return path.replaceFirst(\"~\", System.getProperty(\"user.home\"));\n } else {\n return path;\n }\n }",
"class_method_signature": "FileUtil.expandUserHomeInPath(String path)",
"constructo... | {
"created": null,
"fork": null,
"fork_count": 21,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 47536480,
"size": 16942,
"stargazer_count": 58,
"stars": null,
"updates": null,
"url": "https://github.com/aliyun/aliyun-odps-console"
} |
47536480_125 | {
"fields": [],
"file": "odps-console-dship/src/test/java/com/aliyun/odps/ship/common/UtilTest.java",
"identifier": "UtilTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testIgnoreCharset() {\n assertTrue(Util.isIgnoreCharset(null));\n assertTrue(Util.isIgnoreCharset(Constants.IGNORE_CHARSET));\n assertFalse(Util.isIgnoreCharset(\"gbk\"));\n assertFalse(Util.isIgnoreCharset(\"utf-8\"));\n }",
"class_method_signature": "UtilTest.testIgnor... | {
"fields": [],
"file": "odps-console-dship/src/main/java/com/aliyun/odps/ship/common/Util.java",
"identifier": "Util",
"interfaces": "",
"methods": [
{
"class_method_signature": "Util.getRootDir()",
"constructor": false,
"full_signature": "private static String getRootDir()",
"ide... | {
"body": "public static boolean isIgnoreCharset(String charset) {\n return charset == null || charset.toLowerCase().equals(Constants.IGNORE_CHARSET);\n }",
"class_method_signature": "Util.isIgnoreCharset(String charset)",
"constructor": false,
"full_signature": "public static boolean isIgnoreCharset(String... | {
"created": null,
"fork": null,
"fork_count": 21,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 47536480,
"size": 16942,
"stargazer_count": 58,
"stars": null,
"updates": null,
"url": "https://github.com/aliyun/aliyun-odps-console"
} |
47536480_57 | {
"fields": [
{
"declarator": "positives =\n {\"LIST RESOURCES\", \"list Resources\", \" list resources \\r\",\n \"ls resources\", \"LS RESOURCES\", \"ls resources -l\",\n \"\\n\\r\\t List\\tresources \\n\\r\\t\", \"\\n\\r\\t ls\\tresources \\n\\r\\t\"}",
"modifier": "private stat... | {
"body": "@Test(expected = ODPSConsoleException.class)\n public void testLackParas() throws ODPSConsoleException {\n ExecutionContext context = ExecutionContext.init();\n\n for (String cmd : badPara) {\n ListResourcesCommand.parse(cmd, context);\n }\n }",
"class_method_signature": "ListResourcesCom... | {
"fields": [
{
"declarator": "HELP_TAGS =\n new String[]{\"list\", \"ls\", \"show\", \"resource\", \"resources\"}",
"modifier": "public static final",
"original_string": "public static final String[]\n HELP_TAGS =\n new String[]{\"list\", \"ls\", \"show\", \"resource\", \"resourc... | {
"body": "public static ListResourcesCommand parse(String commandString, ExecutionContext sessionContext)\n throws ODPSConsoleException {\n\n Matcher match = PATTERN.matcher(commandString);\n\n if (match.matches()) {\n Options opts = initOptions();\n CommandLine cl = CommandParserUtils.getComman... | {
"created": null,
"fork": null,
"fork_count": 21,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 47536480,
"size": 16942,
"stargazer_count": 58,
"stars": null,
"updates": null,
"url": "https://github.com/aliyun/aliyun-odps-console"
} |
47536480_94 | {
"fields": [
{
"declarator": "expectEx = ExpectedException.none()",
"modifier": "@Rule\n public",
"original_string": "@Rule\n public ExpectedException expectEx = ExpectedException.none();",
"type": "ExpectedException",
"var_name": "expectEx"
}
],
"file": "odps-console-xflo... | {
"body": "@Test\n public void testDescribeOnLineModelInvalidModelName() throws ODPSConsoleException, OdpsException {\n ExecutionContext context = ExecutionContext.init();\n String cmd = \"desc onlinemodel model-error\";\n expectEx.expect(ODPSConsoleException.class);\n expectEx.expectMessage(ODPSConsoleC... | {
"fields": [
{
"declarator": "HELP_TAGS =\n new String[]{\"describe\", \"desc\", \"online\", \"model\", \"onlinemodel\"}",
"modifier": "public static final",
"original_string": "public static final String[]\n HELP_TAGS =\n new String[]{\"describe\", \"desc\", \"online\", \"model\... | {
"body": "public static DescribeOnlineModelCommand parse(String cmd, ExecutionContext ctx)\n throws ODPSConsoleException {\n\n if (cmd == null || ctx == null) {\n return null;\n }\n\n Matcher m = PATTERN.matcher(cmd);\n boolean match = m.matches();\n\n if (!match) {\n return null;\n ... | {
"created": null,
"fork": null,
"fork_count": 21,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 47536480,
"size": 16942,
"stargazer_count": 58,
"stars": null,
"updates": null,
"url": "https://github.com/aliyun/aliyun-odps-console"
} |
47536480_109 | {
"fields": [],
"file": "odps-console-cupid-public/src/test/java/com/aliyun/openservices/odps/console/cupid/GetJobViewCommandTest.java",
"identifier": "GetJobViewCommandTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testParse() {\n ExecutionContext cxt = new ExecutionContext();\n\n /**\n * 测试是否接受该命令\n */\n //negative, 可能发生歧义的命令\n String[] cmds = {\"wait 123\"};\n GetJobViewCommand result;\n for (String cmd : cmds) {\n try {\n result = GetJobViewCommand.parse(c... | {
"fields": [
{
"declarator": "instanceID",
"modifier": "private",
"original_string": "private String instanceID;",
"type": "String",
"var_name": "instanceID"
},
{
"declarator": "options = initOptions()",
"modifier": "private static final",
"original_string"... | {
"body": "public static GetJobViewCommand parse(String cmd, ExecutionContext cxt)\n throws ODPSConsoleException {\n String regstr = \"\\\\s*wait\\\\s+jobview([\\\\s\\\\S]*)\";\n Pattern pattern = Pattern.compile(regstr, Pattern.CASE_INSENSITIVE);\n Matcher matcher = pattern.matcher(cmd);\n\n if (mat... | {
"created": null,
"fork": null,
"fork_count": 21,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 47536480,
"size": 16942,
"stargazer_count": 58,
"stars": null,
"updates": null,
"url": "https://github.com/aliyun/aliyun-odps-console"
} |
47536480_82 | {
"fields": [
{
"declarator": "expectEx = ExpectedException.none()",
"modifier": "@Rule\n public",
"original_string": "@Rule\n public ExpectedException expectEx = ExpectedException.none();",
"type": "ExpectedException",
"var_name": "expectEx"
}
],
"file": "odps-console-xflo... | {
"body": "@Test\n public void testDescribeOffLineModelMatchNone() throws ODPSConsoleException, OdpsException {\n ExecutionContext context = ExecutionContext.init();\n String cmd = \"desc offlinemodel\";\n DescribeOfflineModelCommand command = DescribeOfflineModelCommand.parse(cmd, context);\n assertNull... | {
"fields": [
{
"declarator": "HELP_TAGS =\n new String[]{\"describe\", \"desc\", \"offline\", \"model\", \"offlinemodel\"}",
"modifier": "public static final",
"original_string": "public static final String[]\n HELP_TAGS =\n new String[]{\"describe\", \"desc\", \"offline\", \"mod... | {
"body": "public static DescribeOfflineModelCommand parse(String cmd, ExecutionContext ctx)\n throws ODPSConsoleException {\n\n if (cmd == null || ctx == null) {\n return null;\n }\n\n Matcher m = PATTERN.matcher(cmd);\n boolean match = m.matches();\n\n if (!match) {\n return null;\n ... | {
"created": null,
"fork": null,
"fork_count": 21,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 47536480,
"size": 16942,
"stargazer_count": 58,
"stars": null,
"updates": null,
"url": "https://github.com/aliyun/aliyun-odps-console"
} |
47536480_31 | {
"fields": [],
"file": "odps-console-public/src/test/java/com/aliyun/openservices/odps/console/pub/DescribeProjectCommandTest.java",
"identifier": "DescribeProjectCommandTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testDescribeProjectExtendedAfterCommand()\n throws ODPSConsoleException, OdpsException {\n ExecutionContext context = ExecutionContext.init();\n Odps odps = OdpsConnectionFactory.createOdps(context);\n AbstractCommand\n command =\n DescribeProjectCommand.par... | {
"fields": [
{
"declarator": "projectName",
"modifier": "private final",
"original_string": "private final String projectName;",
"type": "String",
"var_name": "projectName"
},
{
"declarator": "extended",
"modifier": "private",
"original_string": "private bo... | {
"body": "public static AbstractCommand parse(String cmd, ExecutionContext ctx)\n throws ODPSConsoleException {\n if (cmd == null || ctx == null) {\n return null;\n }\n\n String[] tokens = new AntlrObject(cmd).getTokenStringArray();\n\n if (tokens.length < 2) {\n return null;\n }\n\n ... | {
"created": null,
"fork": null,
"fork_count": 21,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 47536480,
"size": 16942,
"stargazer_count": 58,
"stars": null,
"updates": null,
"url": "https://github.com/aliyun/aliyun-odps-console"
} |
47536480_89 | {
"fields": [
{
"declarator": "expectEx = ExpectedException.none()",
"modifier": "@Rule\n public",
"original_string": "@Rule\n public ExpectedException expectEx = ExpectedException.none();",
"type": "ExpectedException",
"var_name": "expectEx"
}
],
"file": "odps-console-xflo... | {
"body": "@Test\n public void testUpdateOnLineModelParameterError3() throws ODPSConsoleException, OdpsException {\n ExecutionContext context = ExecutionContext.init();\n String cmd = \"update onlinemodel -p prj1 model1 \" +\n \"-target target1 \" +\n \"-id id1 \" +\n \"-libNam... | {
"fields": [
{
"declarator": "HELP_TAGS = new String[]{\"update\", \"model\", \"onlinemodel\", \"online\"}",
"modifier": "public static final",
"original_string": "public static final String[] HELP_TAGS = new String[]{\"update\", \"model\", \"onlinemodel\", \"online\"};",
"type": "String[... | {
"body": "public static UpdateOnlineModelCommand parse(String cmd, ExecutionContext ctx)\n throws ODPSConsoleException {\n if (cmd == null || ctx == null) {\n return null;\n }\n\n OnlineModelInfo modelInfo = CreateOnlineModelCommand.buildOnlineModelInfo(cmd, PATTERN, ctx);\n if (modelInfo == nu... | {
"created": null,
"fork": null,
"fork_count": 21,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 47536480,
"size": 16942,
"stargazer_count": 58,
"stars": null,
"updates": null,
"url": "https://github.com/aliyun/aliyun-odps-console"
} |
47536480_114 | {
"fields": [
{
"declarator": "originalCharset",
"modifier": "static",
"original_string": "static String originalCharset;",
"type": "String",
"var_name": "originalCharset"
}
],
"file": "odps-console-dship/src/test/java/com/aliyun/odps/ship/upload/BlockRecordReaderTest.java",
... | {
"body": "@Test\n public void testReadMultiBlocksAbnormalCase() throws Exception {\n //test startPos is out of boundary,\n {\n //first block will read 2 line\n BlockInfo blockInfo = new BlockInfo(1L, new File(\"src/test/resources/file/reader/one_char_split.txt\"), 100L, 8L);\n BlockRecordReader... | {
"fields": [
{
"declarator": "fieldDelimiter",
"modifier": "private",
"original_string": "private byte[] fieldDelimiter;",
"type": "byte[]",
"var_name": "fieldDelimiter"
},
{
"declarator": "recordDelimiter",
"modifier": "private",
"original_string": "privat... | {
"body": "public byte[][] readTextRecord() throws IOException {\n if (isLastLine) {\n return null;\n }\n currentLine = readLine();\n isLastLine = startPos + readBytes > blockInfo.getStartPos() + blockInfo.getLength();\n return splitLine(currentLine);\n }",
"class_method_signature": "BlockRecor... | {
"created": null,
"fork": null,
"fork_count": 21,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 47536480,
"size": 16942,
"stargazer_count": 58,
"stars": null,
"updates": null,
"url": "https://github.com/aliyun/aliyun-odps-console"
} |
47536480_66 | {
"fields": [
{
"declarator": "thrown= ExpectedException.none()",
"modifier": "@Rule\n public",
"original_string": "@Rule\n public ExpectedException thrown= ExpectedException.none();",
"type": "ExpectedException",
"var_name": "thrown"
}
],
"file": "odps-console-resource/src... | {
"body": "@Test\n public void testDropFunctionCommandNegtive() throws ODPSConsoleException {\n thrown.expect(ODPSConsoleException.class);\n ExecutionContext ctx = ExecutionContext.init();\n DropFunctionCommand command = null;\n command = DropFunctionCommand.parse(\"drop function teststee test_drop\", ct... | {
"fields": [
{
"declarator": "HELP_TAGS = new String[]{\"drop\", \"delete\", \"function\"}",
"modifier": "public static final",
"original_string": "public static final String[] HELP_TAGS = new String[]{\"drop\", \"delete\", \"function\"};",
"type": "String[]",
"var_name": "HELP_TAGS... | {
"body": "public static DropFunctionCommand parse(String commandString, ExecutionContext sessionContext)\n throws ODPSConsoleException {\n\n String[] args = CommandParserUtils.getCommandTokens(commandString);\n if (args.length < 2) {\n return null;\n }\n\n // 检查是否符合DROP FUNCTION FUNCTION_NAME命令... | {
"created": null,
"fork": null,
"fork_count": 21,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 47536480,
"size": 16942,
"stargazer_count": 58,
"stars": null,
"updates": null,
"url": "https://github.com/aliyun/aliyun-odps-console"
} |
47536480_70 | {
"fields": [
{
"declarator": "expectEx = ExpectedException.none()",
"modifier": "@Rule\n public",
"original_string": "@Rule\n public ExpectedException expectEx = ExpectedException.none();",
"type": "ExpectedException",
"var_name": "expectEx"
}
],
"file": "odps-console-xflo... | {
"body": "@Test\n public void testShowOnLineModelsTooManyParams() throws ODPSConsoleException, OdpsException {\n ExecutionContext context = ExecutionContext.init();\n String cmd = \"show onlinemodels a b\";\n expectEx.expect(ODPSConsoleException.class);\n expectEx.expectMessage(ODPSConsoleConstants.BAD_... | {
"fields": [
{
"declarator": "HELP_TAGS = new String[]{\"show\", \"online\", \"model\", \"onlinemodel\"}",
"modifier": "public static final",
"original_string": "public static final String[] HELP_TAGS = new String[]{\"show\", \"online\", \"model\", \"onlinemodel\"};",
"type": "String[]",
... | {
"body": "public static ShowOnlineModelsCommand parse(String cmd, ExecutionContext ctx)\n throws ODPSConsoleException {\n\n if (cmd == null || ctx == null) {\n return null;\n }\n Matcher matcher = PATTERN.matcher(cmd);\n\n if (!matcher.matches()) {\n return null;\n }\n\n String input... | {
"created": null,
"fork": null,
"fork_count": 21,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 47536480,
"size": 16942,
"stargazer_count": 58,
"stars": null,
"updates": null,
"url": "https://github.com/aliyun/aliyun-odps-console"
} |
47536480_102 | {
"fields": [
{
"declarator": "expectEx = ExpectedException.none()",
"modifier": "@Rule\n public",
"original_string": "@Rule\n public ExpectedException expectEx = ExpectedException.none();",
"type": "ExpectedException",
"var_name": "expectEx"
}
],
"file": "odps-console-xflo... | {
"body": "@Test\n public void testCreateOnLineModelExists() throws ODPSConsoleException, OdpsException {\n ExecutionContext context = ExecutionContext.init();\n String cmd = \"create onlinemodel model_exist \" +\n \"-offlinemodelProject online_model_test \" +\n \"-offlinemodelName lr_mod... | {
"fields": [
{
"declarator": "HELP_TAGS = new String[]{\"create\", \"model\", \"onlinemodel\", \"online\"}",
"modifier": "public static final",
"original_string": "public static final String[] HELP_TAGS = new String[]{\"create\", \"model\", \"onlinemodel\", \"online\"};",
"type": "String[... | {
"body": "public static CreateOnlineModelCommand parse(String cmd, ExecutionContext ctx)\n throws ODPSConsoleException {\n\n if (cmd == null || ctx == null) {\n return null;\n }\n\n OnlineModelInfo modelInfo = CreateOnlineModelCommand.buildOnlineModelInfo(cmd, PATTERN, ctx);\n if (modelInfo == ... | {
"created": null,
"fork": null,
"fork_count": 21,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 47536480,
"size": 16942,
"stargazer_count": 58,
"stars": null,
"updates": null,
"url": "https://github.com/aliyun/aliyun-odps-console"
} |
47536480_27 | {
"fields": [
{
"declarator": "positives = {\" SHOW PARTITIONS projectname.tablename\",\n \"\\r\\t\\nShoW\\t\\rPartitions\\n\\tprojectname.tablename\\r\\t\\n\",\n \" LS PARTITIONS projectname.tablename\",\n ... | {
"body": "@Test\n public void testException() throws ODPSConsoleException {\n ExecutionContext ctx = ExecutionContext.init();\n for (String cmd : exceptions) {\n try {\n ShowPartitionsCommand.parse(cmd, ctx);\n Assert.assertNotNull(null);\n } catch (ODPSConsoleException e) {\n\n }... | {
"fields": [
{
"declarator": "HELP_TAGS = new String[]{\"show\", \"list\", \"ls\", \"partition\", \"partitions\"}",
"modifier": "public static final",
"original_string": "public static final String[] HELP_TAGS = new String[]{\"show\", \"list\", \"ls\", \"partition\", \"partitions\"};",
"t... | {
"body": "public static ShowPartitionsCommand parse(String cmd, ExecutionContext cxt)\n throws ODPSConsoleException {\n if (cmd == null || cxt == null) {\n return null;\n }\n\n ShowPartitionsCommand r = null;\n\n Matcher m = PATTERN.matcher(cmd);\n Matcher pubMatcher = PUBLIC_PATTERN.matcher... | {
"created": null,
"fork": null,
"fork_count": 21,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 47536480,
"size": 16942,
"stargazer_count": 58,
"stars": null,
"updates": null,
"url": "https://github.com/aliyun/aliyun-odps-console"
} |
47536480_5 | {
"fields": [],
"file": "odps-console-basic/src/test/java/com/aliyun/openservices/odps/console/commands/InteractiveCommandTest.java",
"identifier": "InteractiveCommandTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testIsDropPartitionCmd() {\n Assert.assertTrue(InteractiveCommand\n .isDropPartitionCmd(\"alter table xxx drop partition(pt='1', ds='2')\"));\n Assert\n .assertTrue(InteractiveCommand\n .isDropPartitionCmd(\"\\t\\nalter \\t\\rtable proj.xxx \\ndrop if exi... | {
"fields": [
{
"declarator": "quit = false",
"modifier": "public static",
"original_string": "public static boolean quit = false;",
"type": "boolean",
"var_name": "quit"
},
{
"declarator": "isInteractiveMode = false",
"modifier": "public static",
"original_... | {
"body": "static boolean isDropPartitionCmd(String cmd) {\n boolean r = false;\n if (cmd != null) {\n Matcher m = IS_DROP_PARTITION.matcher(cmd);\n r = m.matches();\n }\n return r;\n }",
"class_method_signature": "InteractiveCommand.isDropPartitionCmd(String cmd)",
"constructor": false,
... | {
"created": null,
"fork": null,
"fork_count": 21,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 47536480,
"size": 16942,
"stargazer_count": 58,
"stars": null,
"updates": null,
"url": "https://github.com/aliyun/aliyun-odps-console"
} |
47536480_85 | {
"fields": [
{
"declarator": "expectEx = ExpectedException.none()",
"modifier": "@Rule\n public",
"original_string": "@Rule\n public ExpectedException expectEx = ExpectedException.none();",
"type": "ExpectedException",
"var_name": "expectEx"
}
],
"file": "odps-console-xflo... | {
"body": "@Test\n public void testDescribeOffLineModelInvalidModelName() throws ODPSConsoleException, OdpsException {\n ExecutionContext context = ExecutionContext.init();\n String cmd = \"desc offlinemodel model-error\";\n expectEx.expect(ODPSConsoleException.class);\n expectEx.expectMessage(ODPSConsol... | {
"fields": [
{
"declarator": "HELP_TAGS =\n new String[]{\"describe\", \"desc\", \"offline\", \"model\", \"offlinemodel\"}",
"modifier": "public static final",
"original_string": "public static final String[]\n HELP_TAGS =\n new String[]{\"describe\", \"desc\", \"offline\", \"mod... | {
"body": "public static DescribeOfflineModelCommand parse(String cmd, ExecutionContext ctx)\n throws ODPSConsoleException {\n\n if (cmd == null || ctx == null) {\n return null;\n }\n\n Matcher m = PATTERN.matcher(cmd);\n boolean match = m.matches();\n\n if (!match) {\n return null;\n ... | {
"created": null,
"fork": null,
"fork_count": 21,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 47536480,
"size": 16942,
"stargazer_count": 58,
"stars": null,
"updates": null,
"url": "https://github.com/aliyun/aliyun-odps-console"
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.