ODPSConsoleUtils { public static String[] parseTableSpec(String str) { String[] r = new String[2]; if (str != null && str.length() > 0) { int idx = str.indexOf('.'); if (idx == -1) { r[1] = str; } else { r[0] = str.substring(0, idx); r[1] = str.substring(idx + 1, str.length()); } } if (r[0] != null && r[0].trim().length() == 0) { r[0] = null; } if (r[1] != null && r[1].trim().length() == 0) { r[1] = null; } return r; }  static String formatDate(Date date); @SuppressWarnings("resource") static void formaterTable(List<String[]> contentList, int[] columnPercent, int width); static void formaterTableRow(String[] str, int[] columnPercent, int width); static int getConsoleWidth(); static boolean isWindows(); static String getConfigFilePath(); static String getMvnVersion(); static String getUserAgent(); static boolean containsHanBlock(String s); static String shiftOption(List<String> optionList, String option); static TablePart getTablePart(String cmd); static TablePart getTablePartFromPubCommand(String cmd); static String[] parseTableSpec(String str); static String generateLogView(Odps odps, Instance instance, ExecutionContext context); static String[] translateCommandline(String line); synchronized static String runCommand(AbstractCommand command); static void checkThreadInterrupted(); static ODPSConsoleReader getOdpsConsoleReader(); static String safeGetString(LazyLoad resource, String methodName); static String safeGetDateString(LazyLoad resource, String methodName); static Object safeGetObject(LazyLoad resource, String methodName); static int compareVersion(String left, String right); static Map<String, Integer> getDisplayWidth(List<Column> columns,
                                                     List<Column> partitionsColumns,
                                                     List<String> selectColumns); static String makeOutputFrame(Map<String, Integer> displayWidth); static String makeTitle(List<Column> columns, Map<String, Integer> displayWidth); static final SimpleDateFormat DATE_FORMAT; }
@Test public void testParseTableSpec() { test("tablename", new String[] { null, "tablename" }); test("projectname.tablename", new String[] { "projectname", "tablename" }); test(".tablename", new String[] { null, "tablename" }); test(".", new String[] { null, null }); test("", new String[]{null, null}); test(null, new String[]{null, null}); }