@Override public String toErrorString() { return "\n" + Joiner.on("\n").join(errors); }
/** * Removes extra spaces and empty values in a CSV String * @param csv The CSV string to be sanitized * @return The sanitized CSV string */ public static String sanitizeCSV(String csv) { // tokenize String[] tokens = csv.split(","); ArrayList<String> sanitizedTokens = new ArrayList<String>(tokens.length); // check for empties for (String s : tokens) { String trimmedToken = s.trim(); if (trimmedToken.length() != 0) { sanitizedTokens.add(trimmedToken); } } String result = ""; if (sanitizedTokens.size() != 0) { result = Joiner.on(",").join(sanitizedTokens); } return result; }
public String toString() { return Joiner.on(".").join(getSchemaPath()); }
@Override public String getSQLKeywords() throws SQLException { checkOpen(); if (!getServerMetaSupported()) { return super.getSQLKeywords(); } return Joiner.on(",").join(getServerMeta().getSqlKeywordsList()); }
@Override public String getSystemFunctions() throws SQLException { checkOpen(); if (!getServerMetaSupported()) { return super.getSystemFunctions(); } return Joiner.on(",").join(getServerMeta().getSystemFunctionsList()); }
@Override public String getTimeDateFunctions() throws SQLException { checkOpen(); if (!getServerMetaSupported()) { return super.getTimeDateFunctions(); } return Joiner.on(",").join(getServerMeta().getDateTimeFunctionsList()); }
@Override public String getNumericFunctions() throws SQLException { checkOpen(); if (!getServerMetaSupported()) { return super.getNumericFunctions(); } return Joiner.on(",").join(getServerMeta().getNumericFunctionsList()); }
@Override public String getStringFunctions() throws SQLException { checkOpen(); if (!getServerMetaSupported()) { return super.getStringFunctions(); } return Joiner.on(",").join(getServerMeta().getStringFunctionsList()); }
private static String getDigest(int minWidth, int maxWidth, Map<DrillbitEndpoint, EndpointAffinity> affinityMap) { StringBuilder sb = new StringBuilder(); sb.append(String.format("[minWidth = %d, maxWidth=%d, epAff=[", minWidth, maxWidth)); sb.append(Joiner.on(",").join(affinityMap.values())); sb.append("]]"); return sb.toString(); }
@Override public String toString() { return Joiner.on(", ") .appendTo(new StringBuilder().append('['), this) .append(']') .toString(); } };
@Override public String toString() { StringBuilder builder = new StringBuilder(); builder.append(function); builder.append("("); builder.append(Joiner.on(",").join(args)); builder.append(")"); return builder.toString(); } }
@Override public String toErrorString() { return "\n" + Joiner.on("\n").join(errors); }
TypeVariable<?> captureAsTypeVariable(Type[] upperBounds) { String name = "capture#" + id.incrementAndGet() + "-of ? extends " + Joiner.on('&').join(upperBounds); return Types.newArtificialTypeVariable(WildcardCapturer.class, name, upperBounds); }
public String getAdminUserGroups(OptionManager optionManager) { String adminUserGroups = optionManager.getOption(ExecConstants.ADMIN_USER_GROUPS_VALIDATOR); // if this option has not been changed by the user then return the // process user groups if (adminUserGroups.equals(DEFAULT_ADMIN_USER_GROUPS)) { adminUserGroups = Joiner.on(",").join(ImpersonationUtil.getProcessUserGroupNames()); } adminUserGroups = DrillStringUtils.sanitizeCSV(adminUserGroups); return adminUserGroups; } }
private Path getPath() { ExecProtos.FragmentHandle handle = context.getHandle(); String qid = QueryIdHelper.getQueryId(handle.getQueryId()); int majorFragmentId = handle.getMajorFragmentId(); int minorFragmentId = handle.getMinorFragmentId(); String fileName = Joiner.on(Path.SEPARATOR).join(getDir(), qid, majorFragmentId, minorFragmentId, oppositeId, bufferIndex); return new Path(fileName); } }
@Override public String getSystemFunctions() throws SQLException { checkOpen(); if (!getServerMetaSupported()) { return super.getSystemFunctions(); } return Joiner.on(",").join(getServerMeta().getSystemFunctionsList()); }
@Override public String getTimeDateFunctions() throws SQLException { checkOpen(); if (!getServerMetaSupported()) { return super.getTimeDateFunctions(); } return Joiner.on(",").join(getServerMeta().getDateTimeFunctionsList()); }
@Override public String getNumericFunctions() throws SQLException { checkOpen(); if (!getServerMetaSupported()) { return super.getNumericFunctions(); } return Joiner.on(",").join(getServerMeta().getNumericFunctionsList()); }
@Override public String getStringFunctions() throws SQLException { checkOpen(); if (!getServerMetaSupported()) { return super.getStringFunctions(); } return Joiner.on(",").join(getServerMeta().getStringFunctionsList()); }
@Override public String getSQLKeywords() throws SQLException { checkOpen(); if (!getServerMetaSupported()) { return super.getSQLKeywords(); } return Joiner.on(",").join(getServerMeta().getSqlKeywordsList()); }