Tabnine Logo
Description
Code IndexAdd Tabnine to your IDE (free)

How to use
Description
in
io.prestosql.spi.function

Best Java code snippets using io.prestosql.spi.function.Description (Showing top 20 results out of 315)

origin: io.prestosql/presto-main

@Description("absolute value")
@ScalarFunction("abs")
@SqlType(StandardTypes.REAL)
public static long absFloat(@SqlType(StandardTypes.REAL) long num)
{
  return floatToRawIntBits(Math.abs(intBitsToFloat((int) num)));
}
origin: io.prestosql/presto-main

  private static String getDescription(AnnotatedElement annotatedElement)
  {
    Description description = annotatedElement.getAnnotation(Description.class);
    return (description == null) ? null : description.value();
  }
}
origin: io.prestosql/presto-main

@Description("round to integer by dropping digits after decimal point")
@ScalarFunction
@SqlType(StandardTypes.DOUBLE)
public static double truncate(@SqlType(StandardTypes.DOUBLE) double num)
{
  return Math.signum(num) * Math.floor(Math.abs(num));
}
origin: io.prestosql/presto-main

@Description("constant representing not-a-number")
@ScalarFunction("nan")
@SqlType(StandardTypes.DOUBLE)
public static double NaN()
{
  return Double.NaN;
}
origin: io.prestosql/presto-main

@Description("remainder of given quotient")
@ScalarFunction("mod")
@SqlType(StandardTypes.REAL)
public static long modFloat(@SqlType(StandardTypes.REAL) long num1, @SqlType(StandardTypes.REAL) long num2)
{
  return floatToRawIntBits(intBitsToFloat((int) num1) % intBitsToFloat((int) num2));
}
origin: io.prestosql/presto-main

@Description("absolute value")
@ScalarFunction
@SqlType(StandardTypes.DOUBLE)
public static double abs(@SqlType(StandardTypes.DOUBLE) double num)
{
  return Math.abs(num);
}
origin: io.prestosql/presto-main

@Description("arc cosine")
@ScalarFunction
@SqlType(StandardTypes.DOUBLE)
public static double acos(@SqlType(StandardTypes.DOUBLE) double num)
{
  return Math.acos(num);
}
origin: io.prestosql/presto-main

@Description("Euler's number raised to the given power")
@ScalarFunction
@SqlType(StandardTypes.DOUBLE)
public static double exp(@SqlType(StandardTypes.DOUBLE) double num)
{
  return Math.exp(num);
}
origin: io.prestosql/presto-main

@Description("signum")
@ScalarFunction("sign")
@SqlType(StandardTypes.INTEGER)
public static long signInteger(@SqlType(StandardTypes.INTEGER) long num)
{
  return (long) Math.signum(num);
}
origin: io.prestosql/presto-main

@Description("converts an angle in radians to degrees")
@ScalarFunction
@SqlType(StandardTypes.DOUBLE)
public static double degrees(@SqlType(StandardTypes.DOUBLE) double radians)
{
  return Math.toDegrees(radians);
}
origin: io.prestosql/presto-main

@Description("a pseudo-random value")
@ScalarFunction(alias = "rand", deterministic = false)
@SqlType(StandardTypes.DOUBLE)
public static double random()
{
  return ThreadLocalRandom.current().nextDouble();
}
origin: io.prestosql/presto-main

@Description("signum")
@ScalarFunction
@SqlType(StandardTypes.DOUBLE)
public static double sign(@SqlType(StandardTypes.DOUBLE) double num)
{
  return Math.signum(num);
}
origin: io.prestosql/presto-main

@Description("a pseudo-random number between 0 and value (exclusive)")
@ScalarFunction(value = "random", alias = "rand", deterministic = false)
@SqlType(StandardTypes.TINYINT)
public static long randomTinyint(@SqlType(StandardTypes.TINYINT) long value)
{
  checkCondition(value > 0, INVALID_FUNCTION_ARGUMENT, "bound must be positive");
  return ThreadLocalRandom.current().nextInt((int) value);
}
origin: io.prestosql/presto-main

@Description("a pseudo-random number between 0 and value (exclusive)")
@ScalarFunction(alias = "rand", deterministic = false)
@SqlType(StandardTypes.BIGINT)
public static long random(@SqlType(StandardTypes.BIGINT) long value)
{
  checkCondition(value > 0, INVALID_FUNCTION_ARGUMENT, "bound must be positive");
  return ThreadLocalRandom.current().nextLong(value);
}
origin: io.prestosql/presto-main

@ScalarFunction("scalar_with_nullable_complex")
@Description("Simple scalar with nullable complex type")
public static class WithNullableComplexArgScalarFunction
{
  @SqlType(StandardTypes.DOUBLE)
  public static double fun(
      @SqlType(StandardTypes.DOUBLE) double v,
      @SqlNullable @SqlType(StandardTypes.DOUBLE) Double v2)
  {
    return v;
  }
}
origin: io.prestosql/presto-main

@ScalarFunction("fixed_type_parameter_scalar_function")
@Description("Parametric scalar that uses TypeParameter with fixed type")
public static final class FixedTypeParameterScalarFunction
{
  @SqlType(StandardTypes.BIGINT)
  public static long fun(
      @TypeParameter("ROW(ARRAY(BIGINT),ROW(ROW(CHAR)),BIGINT,MAP(BIGINT,CHAR))") Type type,
      @SqlType(StandardTypes.BIGINT) long value)
  {
    return value;
  }
}
origin: io.prestosql/presto-main

@Description("encode binary data as hex")
@ScalarFunction
@SqlType(StandardTypes.VARCHAR)
public static Slice toHex(@SqlType(StandardTypes.VARBINARY) Slice slice)
{
  return Slices.utf8Slice(BaseEncoding.base16().encode(slice.getBytes()));
}
origin: io.prestosql/presto-main

@Description("encode value as a big endian varbinary according to IEEE 754 double-precision floating-point format")
@ScalarFunction("to_ieee754_64")
@SqlType(StandardTypes.VARBINARY)
public static Slice toIEEE754Binary64(@SqlType(StandardTypes.DOUBLE) double value)
{
  Slice slice = Slices.allocate(Double.BYTES);
  slice.setLong(0, Long.reverseBytes(Double.doubleToLongBits(value)));
  return slice;
}
origin: io.prestosql/presto-main

@Description("round up to nearest integer")
@ScalarFunction(alias = "ceil")
@SqlType(StandardTypes.BIGINT)
public static long ceiling(@SqlType(StandardTypes.BIGINT) long num)
{
  return num;
}
origin: io.prestosql/presto-main

@Description("round down to nearest integer")
@ScalarFunction("floor")
@SqlType(StandardTypes.INTEGER)
public static long floorInteger(@SqlType(StandardTypes.INTEGER) long num)
{
  return num;
}
io.prestosql.spi.functionDescription

Most used methods

  • <init>
  • value

Popular in Java

  • Updating database using SQL prepared statement
  • addToBackStack (FragmentTransaction)
  • requestLocationUpdates (LocationManager)
  • scheduleAtFixedRate (Timer)
  • Thread (java.lang)
    A thread is a thread of execution in a program. The Java Virtual Machine allows an application to ha
  • Collection (java.util)
    Collection is the root of the collection hierarchy. It defines operations on data collections and t
  • Callable (java.util.concurrent)
    A task that returns a result and may throw an exception. Implementors define a single method with no
  • ConcurrentHashMap (java.util.concurrent)
    A plug-in replacement for JDK1.5 java.util.concurrent.ConcurrentHashMap. This version is based on or
  • Servlet (javax.servlet)
    Defines methods that all servlets must implement. A servlet is a small Java program that runs within
  • Join (org.hibernate.mapping)
  • Top 17 Plugins for Android Studio
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyStudentsTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now