awsglue

package
v0.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 7, 2020 License: AGPL-3.0, Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	LogS3Prefix = "logs"

	TablesDatabaseName        = "panther_tables"
	TablesDatabaseDescription = "Holds tables generated by Panther data processing"

	ViewsDatabaseName        = "panther_views"
	ViewsDatabaseDescription = "Holds views useful for querying Panther tables"

	GlueTimestampType = "timestamp" // type in Glue tables for timestamps that we will re-map Go times
)

Variables

This section is empty.

Functions

This section is empty.

Types

type GlueMetadata

type GlueMetadata struct {
	// contains filtered or unexported fields
}

Meta data about Glue table over parser data written to S3 NOTE: this struct has all accessor behind functions to allow a lazy evaluation

so the cost of creating the schema is only when actually needing this information.

func NewGlueMetadata

func NewGlueMetadata(databaseName, tableName, description string, timebin GlueTableTimebin,
	timeUnpadded bool, eventStruct interface{}) (gm *GlueMetadata, err error)

func (*GlueMetadata) CreateJSONPartition

func (gm *GlueMetadata) CreateJSONPartition(client glueiface.GlueAPI, s3Bucket string, t time.Time) (err error)

func (*GlueMetadata) DatabaseName

func (gm *GlueMetadata) DatabaseName() string

func (*GlueMetadata) DeletePartition

func (gm *GlueMetadata) DeletePartition(client glueiface.GlueAPI, t time.Time) (output *glue.DeletePartitionOutput, err error)

func (*GlueMetadata) Description

func (gm *GlueMetadata) Description() string

func (*GlueMetadata) EventStruct

func (gm *GlueMetadata) EventStruct() interface{}

func (*GlueMetadata) GetPartition

func (gm *GlueMetadata) GetPartition(client glueiface.GlueAPI, t time.Time) (output *glue.GetPartitionOutput, err error)

func (*GlueMetadata) PartitionKeys added in v0.2.0

func (gm *GlueMetadata) PartitionKeys() (partitions []Partition)

func (*GlueMetadata) PartitionPrefix

func (gm *GlueMetadata) PartitionPrefix(t time.Time) (prefix string)

Based on Timebin(), return an S3 prefix for objects

func (*GlueMetadata) PartitionValues

func (gm *GlueMetadata) PartitionValues(t time.Time) (values []*string)

Based on Timebin(), return an []*string values (used for Glue APIs)

func (*GlueMetadata) S3Prefix

func (gm *GlueMetadata) S3Prefix() string

func (*GlueMetadata) TableName

func (gm *GlueMetadata) TableName() string

func (*GlueMetadata) Timebin

func (gm *GlueMetadata) Timebin() GlueTableTimebin

type GlueTableTimebin

type GlueTableTimebin int

Use this to tag the time partitioning used in a Glue table

const (
	GlueTableMonthly GlueTableTimebin = iota + 1
	GlueTableDaily
	GlueTableHourly
)

func (GlueTableTimebin) Validate

func (tb GlueTableTimebin) Validate() (err error)

type Partition added in v0.2.0

type Partition struct {
	Name string
	Type string
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL