Class CsvRelation

java.lang.Object
nz.org.riskscape.engine.relation.BaseRelation
nz.org.riskscape.engine.relation.CsvRelation
All Implemented Interfaces:
AutoCloseable, nz.org.riskscape.engine.data.SelfDescribingScalarData, nz.org.riskscape.engine.pipeline.Realized, nz.org.riskscape.engine.relation.Relation

public class CsvRelation extends nz.org.riskscape.engine.relation.BaseRelation

Native CSV support for a relation. Mostly here to allow CSV files without geometry to be used in queries in support of the table model template - https://bugs.riskscape.org.nz/issues/192

  • Nested Class Summary

    Nested classes/interfaces inherited from class nz.org.riskscape.engine.relation.BaseRelation

    nz.org.riskscape.engine.relation.BaseRelation.Fields, nz.org.riskscape.engine.relation.BaseRelation.Transformer
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final org.apache.commons.io.ByteOrderMark[]
     
    static final String
    Name of magic line number struct member that is included in Tuples when a CsvRelation is constructed with includeLineNumbers.

    Fields inherited from class nz.org.riskscape.engine.relation.BaseRelation

    skipOnInvalid, transformers
  • Method Summary

    Modifier and Type
    Method
    Description
    protected CsvRelation
    clone(nz.org.riskscape.engine.relation.BaseRelation.Fields baseFields)
     
    fromBytes(byte[] bytes)
     
    fromBytes(byte[] bytes, boolean includeLineNumbers)
    Construct a new CsvRelation from the given bytes, assumed to be in the platform default character set.
    fromUrl(URL url)
     
    fromUrl(URL url, boolean includeLineNumbers)
    Construct a new CsvRelation from the given url
     
     
    static nz.org.riskscape.engine.types.Struct
     
    nz.org.riskscape.engine.relation.TupleIterator
     
     

    Methods inherited from class nz.org.riskscape.engine.relation.BaseRelation

    cloneWithProjectionIfSupported, cloneWithRestrictionIfSupported, cloneWithTransformer, getLimit, getOffset, getRawType, getSpatialMetadata, getType, hasSkipOnInvalid, iterator, limitAndOffset, project, restrict, skipInvalid, skipOrThrow, toString

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

    Methods inherited from interface nz.org.riskscape.engine.pipeline.Realized

    close

    Methods inherited from interface nz.org.riskscape.engine.relation.Relation

    calculateBounds, getScalarDataType, limit, offset, stream
  • Field Details

    • LINE_NUM_KEY

      public static final String LINE_NUM_KEY

      Name of magic line number struct member that is included in Tuples when a CsvRelation is constructed with includeLineNumbers.

      See Also:
    • ACCEPTED_BOMS

      public static final org.apache.commons.io.ByteOrderMark[] ACCEPTED_BOMS
  • Method Details

    • fromUrl

      public static CsvRelation fromUrl(URL url)
    • fromUrl

      public static CsvRelation fromUrl(URL url, boolean includeLineNumbers)

      Construct a new CsvRelation from the given url

    • fromBytes

      public static CsvRelation fromBytes(byte[] bytes)
    • fromBytes

      public static CsvRelation fromBytes(byte[] bytes, boolean includeLineNumbers)

      Construct a new CsvRelation from the given bytes, assumed to be in the platform default character set. relation.

    • inferType

      public static nz.org.riskscape.engine.types.Struct inferType(Reader in)
    • rawIterator

      public nz.org.riskscape.engine.relation.TupleIterator rawIterator()
      Specified by:
      rawIterator in class nz.org.riskscape.engine.relation.BaseRelation
    • getSourceInformation

      public String getSourceInformation()
    • clone

      protected CsvRelation clone(nz.org.riskscape.engine.relation.BaseRelation.Fields baseFields)
      Specified by:
      clone in class nz.org.riskscape.engine.relation.BaseRelation
    • size

      public Optional<Long> size()
    • getSourceDescription

      public String getSourceDescription()