### Question:
GlueExpressionUtil { @VisibleForTesting static Optional<String> buildGlueExpressionForSingleDomain(String columnName, Domain domain, boolean assumeCanonicalPartitionKeys) { ValueSet valueSet = domain.getValues(); if (domain.isAll() || !canConvertSqlTypeToStringForGlue(domain.getType(), assumeCanonicalPartitionKeys)) { return Optional.empty(); } if (domain.getValues().isAll()) { return Optional.of(format("(%s <> '%s')", columnName, NULL_STRING)); } if (domain.getValues().isNone()) { return Optional.of(format("(%s = '%s')", columnName, NULL_STRING)); } List<String> disjuncts = new ArrayList<>(); List<String> singleValues = new ArrayList<>(); for (Range range : valueSet.getRanges().getOrderedRanges()) { checkState(!range.isAll()); if (range.isSingleValue()) { Marker rangeLow = range.getLow(); singleValues.add(valueToString(rangeLow.getType(), rangeLow.getValue())); } else { List<String> rangeConjuncts = new ArrayList<>(); if (!range.getLow().isLowerUnbounded()) { Marker rangeLow = range.getLow(); switch (range.getLow().getBound()) { case ABOVE: rangeConjuncts.add(format( "%s > %s", columnName, valueToString(rangeLow.getType(), rangeLow.getValue()))); break; case EXACTLY: rangeConjuncts.add(format( "%s >= %s", columnName, valueToString(rangeLow.getType(), rangeLow.getValue()))); break; case BELOW: throw new IllegalArgumentException("Low marker should never use BELOW bound"); default: throw new AssertionError("Unhandled bound: " + range.getLow().getBound()); } } if (!range.getHigh().isUpperUnbounded()) { Marker rangeHigh = range.getHigh(); switch (range.getHigh().getBound()) { case ABOVE: throw new IllegalArgumentException("High marker should never use ABOVE bound"); case EXACTLY: rangeConjuncts.add(format( "%s <= %s", columnName, valueToString(rangeHigh.getType(), rangeHigh.getValue()))); break; case BELOW: rangeConjuncts.add(format( "%s < %s", columnName, valueToString(rangeHigh.getType(), rangeHigh.getValue()))); break; default: throw new AssertionError("Unhandled bound: " + range.getHigh().getBound()); } } checkState(!rangeConjuncts.isEmpty()); disjuncts.add("(" + CONJUNCT_JOINER.join(rangeConjuncts) + ")"); } } if (singleValues.size() == 1) { String equalsTest = format("(%s = %s)", columnName, getOnlyElement(singleValues)); disjuncts.add(equalsTest); } else if (singleValues.size() > 1) { String values = Joiner.on(", ").join(singleValues); String inClause = format("(%s in (%s))", columnName, values); disjuncts.add(inClause); } return Optional.of("(" + DISJUNCT_JOINER.join(disjuncts) + ")"); } private  GlueExpressionUtil(); static String buildGlueExpression(List<String> columnNames, TupleDomain<String> partitionKeysFilter, boolean assumeCanonicalPartitionKeys); static String buildGlueExpression(List<String> columnNames, TupleDomain<String> partitionKeysFilter, boolean assumeCanonicalPartitionKeys, int expressionLengthLimit);  }### Answer:
@Test public void testBuildGlueExpressionDomainEqualsSingleValue() { Domain domain = Domain.singleValue(VarcharType.VARCHAR, utf8Slice("2020-01-01")); Optional<String> foo = buildGlueExpressionForSingleDomain("foo", domain, true); assertEquals(foo.get(), "((foo = '2020-01-01'))"); }