Skip to content

Commit

Permalink
Merge pull request #54 from estebanzimanyi/develop
Browse files Browse the repository at this point in the history
Implement duration and timespan functions wrt Issue #50
  • Loading branch information
mschoema committed Feb 23, 2021
2 parents 2f49504 + b595490 commit d91cf0e
Show file tree
Hide file tree
Showing 139 changed files with 1,287 additions and 719 deletions.
9 changes: 6 additions & 3 deletions include/doublen.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
/*****************************************************************************
*
* doublen.h
* Internal types used for the average and centroid temporal aggregates.
*
* This MobilityDB code is provided under The PostgreSQL License.
*
Expand All @@ -27,6 +24,12 @@
*
*****************************************************************************/

/**
* @file doublen.h
* Internal types used in particular for computing the average and centroid
* temporal aggregates.
*/

#ifndef __DOUBLEN_H__
#define __DOUBLEN_H__

Expand Down
8 changes: 5 additions & 3 deletions include/lifting.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
/*****************************************************************************
*
* lifting.c
* Generic functions for lifting functions and operators on temporal types.
*
* This MobilityDB code is provided under The PostgreSQL License.
*
Expand All @@ -27,6 +24,11 @@
*
*****************************************************************************/

/**
* @file lifting.c
* Generic functions for lifting functions and operators on temporal types.
*/

#ifndef __LIFTING_H__
#define __LIFTING_H__

Expand Down
8 changes: 5 additions & 3 deletions include/oidcache.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
/*****************************************************************************
*
* oidcache.h
* Functions for building a cache of type and operator Oids.
*
* This MobilityDB code is provided under The PostgreSQL License.
*
Expand All @@ -27,6 +24,11 @@
*
*****************************************************************************/

/**
* @file oidcache.h
* Functions for building a cache of type and operator Oids.
*/

#ifndef OIDCACHE_H
#define OIDCACHE_H

Expand Down
13 changes: 8 additions & 5 deletions include/period.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
/*****************************************************************************
*
* period.h
* Basic routines for timestamptz periods
*
* This MobilityDB code is provided under The PostgreSQL License.
*
Expand Down Expand Up @@ -29,6 +26,12 @@
*
*****************************************************************************/

/**
* @file period.h
* Basic routines for time periods composed of two `TimestampTz` values and
* two Boolean values stating whether the bounds are inclusive or not.
*/

#ifndef __PERIOD_H__
#define __PERIOD_H__

Expand Down Expand Up @@ -79,7 +82,7 @@ extern void period_shift_tscale(Period *result, const Interval *start,

/* period -> interval */

extern Datum period_timespan(PG_FUNCTION_ARGS);
extern Datum period_duration(PG_FUNCTION_ARGS);

/* Functions for defining B-tree index */

Expand Down Expand Up @@ -109,7 +112,7 @@ extern void period_set(Period *p, TimestampTz lower, TimestampTz upper,
bool lower_inc, bool upper_inc);
extern Period *period_copy(const Period *p);
extern float8 period_to_secs(TimestampTz t1, TimestampTz t2);
extern Interval *period_timespan_internal(const Period *p);
extern Interval *period_duration_internal(const Period *p);
extern Period **periodarr_normalize(Period **periods, int count, int *newcount);
extern Period *period_super_union(const Period *p1, const Period *p2);
extern void period_expand(Period *p1, const Period *p2);
Expand Down
9 changes: 6 additions & 3 deletions include/periodset.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
/*****************************************************************************
*
* periodset.c
* Basic functions for set of periods.
*
* This MobilityDB code is provided under The PostgreSQL License.
*
Expand All @@ -27,6 +24,11 @@
*
*****************************************************************************/

/**
* @file periodset.c
* Basic functions for set of disjoint periods.
*/

#ifndef __PERIODSET_H__
#define __PERIODSET_H__

Expand Down Expand Up @@ -76,6 +78,7 @@ extern PeriodSet *timestampset_to_periodset_internal(const TimestampSet *ts);

extern Datum periodset_mem_size(PG_FUNCTION_ARGS);
extern Datum periodset_timespan(PG_FUNCTION_ARGS);
extern Datum periodset_duration(PG_FUNCTION_ARGS);
extern Datum periodset_num_periods(PG_FUNCTION_ARGS);
extern Datum periodset_start_period(PG_FUNCTION_ARGS);
extern Datum periodset_end_period(PG_FUNCTION_ARGS);
Expand Down
8 changes: 5 additions & 3 deletions include/rangetypes_ext.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
/*****************************************************************************
*
* rangetypes_ext.h
* Extension of operators for range types.
*
* This MobilityDB code is provided under The PostgreSQL License.
*
Expand All @@ -27,6 +24,11 @@
*
*****************************************************************************/

/**
* @file rangetypes_ext.h
* Extended operators for range types.
*/

#ifndef __RANGETYPES_EXT_H__
#define __RANGETYPES_EXT_H__

Expand Down
8 changes: 5 additions & 3 deletions include/tbool_boolops.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
/*****************************************************************************
*
* tbool_boolops.h
* Temporal Boolean operators (and, or, not).
*
* This MobilityDB code is provided under The PostgreSQL License.
*
Expand All @@ -27,6 +24,11 @@
*
*****************************************************************************/

/**
* @file tbool_boolops.h
* Temporal Boolean operators (and, or, not).
*/

#ifndef __TBOOL_BOOLOPS_H__
#define __TBOOL_BOOLOPS_H__

Expand Down
8 changes: 5 additions & 3 deletions include/tbox.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
/*****************************************************************************
*
* tbox.h
* Functions for temporal bounding boxes.
*
* This MobilityDB code is provided under The PostgreSQL License.
*
Expand Down Expand Up @@ -29,6 +26,11 @@
*
*****************************************************************************/

/**
* @file tbox.h
* Functions for temporal bounding boxes.
*/

#ifndef __TBOX_H__
#define __TBOX_H__

Expand Down
13 changes: 9 additions & 4 deletions include/temporal.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
/*****************************************************************************
*
* temporal.h
* Basic functions for temporal types of any subtype.
*
* This MobilityDB code is provided under The PostgreSQL License.
*
Expand All @@ -27,6 +24,11 @@
*
*****************************************************************************/

/**
* @file temporal.h
* Basic functions for temporal types of any subtype.
*/

#ifndef __TEMPORAL_H__
#define __TEMPORAL_H__

Expand Down Expand Up @@ -88,6 +90,9 @@
#define BBOX_TEST_NO false

/** Symbolic constants for the make functions */
#define MERGE true
#define MERGE_NO false

#define NORMALIZE true
#define NORMALIZE_NO false

Expand Down Expand Up @@ -486,7 +491,7 @@ extern void ensure_increasing_timestamps(const TInstant *inst1,
const TInstant *inst2, bool strict);
extern void ensure_same_overlapping_value(const TInstant *inst1,
const TInstant *inst2);
extern void ensure_valid_tinstantarr(TInstant **instants, int count);
extern void ensure_valid_tinstantarr(TInstant **instants, int count, bool merge);
extern void ensure_valid_tsequencearr(TSequence **sequences, int count);

/* Input/output functions */
Expand Down
8 changes: 5 additions & 3 deletions include/temporal_aggfuncs.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
/*****************************************************************************
*
* temporal_aggfuncs.h
* Temporal aggregate functions
*
* This MobilityDB code is provided under The PostgreSQL License.
*
Expand All @@ -27,6 +24,11 @@
*
*****************************************************************************/

/**
* @file temporal_aggfuncs.h
* Temporal aggregate functions
*/

#ifndef __TEMPORAL_AGGFUNCS_H__
#define __TEMPORAL_AGGFUNCS_H__

Expand Down
10 changes: 6 additions & 4 deletions include/temporal_analyze.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
/*****************************************************************************
*
* temporal_analyze.h
* Functions for gathering statistics from temporal alphanumeric columns
*
* This MobilityDB code is provided under The PostgreSQL License.
*
Expand All @@ -25,8 +22,13 @@
* AN "AS IS" BASIS, AND UNIVERSITE LIBRE DE BRUXELLES HAS NO OBLIGATIONS TO
* PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. 
*
*-------------------------------------------------------------------------
*****************************************************************************/

/**
* @file temporal_analyze.h
* Functions for gathering statistics from temporal alphanumeric columns
*/

#ifndef __TEMPORAL_ANALYZE_H__
#define __TEMPORAL_ANALYZE_H__

Expand Down
8 changes: 5 additions & 3 deletions include/temporal_boxops.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
/*****************************************************************************
*
* temporal_boxops.h
* Bounding box operators for temporal types.
*
* This MobilityDB code is provided under The PostgreSQL License.
*
Expand All @@ -27,6 +24,11 @@
*
*****************************************************************************/

/**
* @file temporal_boxops.h
* Bounding box operators for temporal types.
*/

#ifndef __TEMPORAL_BOXOPS_H__
#define __TEMPORAL_BOXOPS_H__

Expand Down
8 changes: 5 additions & 3 deletions include/temporal_compops.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
/*****************************************************************************
*
* temporal_compops.h
* Temporal comparison operators (=, <>, <, >, <=, >=).
*
* This MobilityDB code is provided under The PostgreSQL License.
*
Expand All @@ -27,6 +24,11 @@
*
*****************************************************************************/

/**
* @file temporal_compops.h
* Temporal comparison operators (=, <>, <, >, <=, >=).
*/

#ifndef __TEMPORAL_COMPOPS_H__
#define __TEMPORAL_COMPOPS_H__

Expand Down
8 changes: 5 additions & 3 deletions include/temporal_gist.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
/*****************************************************************************
*
* temporal_gist.c
* Quad-tree SP-GiST index for temporal boolean and temporal text types.
*
* This MobilityDB code is provided under The PostgreSQL License.
*
Expand All @@ -27,6 +24,11 @@
*
*****************************************************************************/

/**
* @file temporal_gist.h
* Quad-tree SP-GiST index for temporal boolean and temporal text types.
*/

#ifndef __TEMPORAL_GIST_H__
#define __TEMPORAL_GIST_H__

Expand Down
8 changes: 5 additions & 3 deletions include/temporal_parser.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
/*****************************************************************************
*
* temporal_parser.h
* Functions for parsing temporal types.
*
* This MobilityDB code is provided under The PostgreSQL License.
*
Expand All @@ -27,6 +24,11 @@
*
*****************************************************************************/

/**
* @file temporal_parser.h
* Functions for parsing temporal types.
*/

#ifndef __TEMPORAL_PARSER_H__
#define __TEMPORAL_PARSER_H__

Expand Down
8 changes: 5 additions & 3 deletions include/temporal_posops.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
/*****************************************************************************
*
* temporal_posops.h
* Relative position operators for temporal types.
*
* This MobilityDB code is provided under The PostgreSQL License.
*
Expand All @@ -27,6 +24,11 @@
*
*****************************************************************************/

/**
* @file temporal_posops.h
* Relative position operators for temporal types.
*/

#ifndef __TEMPORAL_POSOPS_H__
#define __TEMPORAL_POSOPS_H__

Expand Down
8 changes: 5 additions & 3 deletions include/temporal_selfuncs.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
/*****************************************************************************
*
* temporal_selfuncs.h
* Selectivity functions for the temporal types
*
* This MobilityDB code is provided under The PostgreSQL License.
*
Expand All @@ -27,6 +24,11 @@
*
*****************************************************************************/

/**
* @file temporal_selfuncs.h
* Selectivity functions for temporal types
*/

#ifndef __TEMPORAL_SELFUNCS_H__
#define __TEMPORAL_SELFUNCS_H__

Expand Down

0 comments on commit d91cf0e

Please sign in to comment.