@@ -0,0 +1,2558 @@
+/*%0A * Licensed under the Apache License, Version 2.0 (the %22License%22);%0A * you may not use this file except in compliance with the License.%0A * You may obtain a copy of the License at%0A *%0A *     http://www.apache.org/licenses/LICENSE-2.0%0A *%0A * Unless required by applicable law or agreed to in writing, software%0A * distributed under the License is distributed on an %22AS IS%22 BASIS,%0A * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.%0A * See the License for the specific language governing permissions and%0A * limitations under the License.%0A */%0Apackage com.facebook.presto.sql.gen;%0A%0Aimport com.facebook.presto.byteCode.ByteCodeNode;%0Aimport com.facebook.presto.byteCode.CompilerContext;%0Aimport com.facebook.presto.byteCode.expression.ByteCodeExpression;%0Aimport com.facebook.presto.byteCode.instruction.InvokeInstruction;%0Aimport com.facebook.presto.spi.type.Type;%0Aimport com.google.common.collect.ImmutableList;%0A%0Aimport java.lang.invoke.MethodHandles;%0Aimport java.lang.reflect.Method;%0Aimport java.util.List;%0A%0Aimport static com.facebook.presto.byteCode.ParameterizedType.type;%0Aimport static com.google.common.base.Preconditions.checkNotNull;%0A%0Apublic class SqlTypeByteCodeExpression%0A        extends ByteCodeExpression%0A%7B%0A    public static ByteCodeExpression constantType(CompilerContext context, CallSiteBinder callSiteBinder, Type type)%0A    %7B%0A        checkNotNull(context, %22context is null%22);%0A        checkNotNull(callSiteBinder, %22callSiteBinder is null%22);%0A        checkNotNull(type, %22type is null%22);%0A%0A        Binding binding = callSiteBinder.bind(MethodHandles.constant(type.getClass(), type));%0A        return new SqlTypeByteCodeExpression(type, binding, context.getDefaultBootstrapMethod());%0A    %7D%0A%0A    private final Type type;%0A    private final Binding binding;%0A    private final Method bootstrapMethod;%0A%0A    private SqlTypeByteCodeExpression(Type type, Binding binding, Method bootstrapMethod)%0A    %7B%0A        super(type(type.getClass()));%0A%0A        this.type = checkNotNull(type, %22type is null%22);%0A        this.binding = checkNotNull(binding, %22binding is null%22);%0A        this.bootstrapMethod = checkNotNull(bootstrapMethod, %22bootstrapMethod is null%22);%0A    %7D%0A%0A    @Override%0A    public ByteCodeNode getByteCode()%0A    %7B%0A        return InvokeInstruction.invokeDynamic(type.getName(), binding.getType(), bootstrapMethod, binding.getBindingId());%0A    %7D%0A%0A    @Override%0A    public List%3CByteCodeNode%3E getChildNodes()%0A    %7B%0A        return ImmutableList.of();%0A    %7D%0A%0A    @Override%0A    public String toString()%0A    %7B%0A        return type.getName();%0A    %7D%0A%7D%0A

Add SqlTypeByteCodeExpression