Class ArrowResultUtil


  • public class ArrowResultUtil
    extends Object
    Result utility methods specifically for Arrow format
    • Field Detail

    • Constructor Detail

      • ArrowResultUtil

        public ArrowResultUtil()
    • Method Detail

      • powerOfTen

        public static long powerOfTen​(int pow)
      • getStringFormat

        public static String getStringFormat​(int scale)
      • getDate

        public static Date getDate​(int day)
        new method to get Date from integer
        Parameters:
        day -
        Returns:
        Date
      • getDate

        public static Date getDate​(int day,
                                   TimeZone oldTz,
                                   TimeZone newTz)
                            throws SFException
        Method to get Date from integer using timezone offsets
        Parameters:
        day -
        oldTz -
        newTz -
        Returns:
        Throws:
        SFException
      • moveToTimeZone

        public static Timestamp moveToTimeZone​(Timestamp ts,
                                               TimeZone oldTZ,
                                               TimeZone newTZ)
        move the input timestamp form oldTZ to newTZ
        Parameters:
        ts -
        oldTZ -
        newTZ -
        Returns:
        timestamp in newTZ
      • toJavaTimestamp

        public static Timestamp toJavaTimestamp​(long epoch,
                                                int scale)
        generate Java Timestamp object
        Parameters:
        epoch - the value since epoch time
        scale - the scale of the value
        Returns:
      • isTimestampOverflow

        public static boolean isTimestampOverflow​(long seconds)
        check whether the input seconds out of the scope of Java timestamp
        Parameters:
        seconds -
        Returns:
      • createTimestamp

        public static Timestamp createTimestamp​(long seconds,
                                                int fraction,
                                                TimeZone timezone,
                                                boolean useSessionTz)
        create Java timestamp using seconds since epoch and fraction in nanoseconds For example, 1232.234 represents as epoch = 1232 and fraction = 234,000,000 For example, -1232.234 represents as epoch = -1233 and fraction = 766,000,000 For example, -0.13 represents as epoch = -1 and fraction = 870,000,000
        Parameters:
        seconds -
        fraction -
        timezone - - The timezone being used for the toString() formatting
        timezone - -
        Returns:
        java timestamp object