Skip to content

Commit

Permalink
fix: prefix timescale functions (when called from non default tenant) (
Browse files Browse the repository at this point in the history
  • Loading branch information
bobeal authored Mar 29, 2024
1 parent 89ecf75 commit 2a02a7c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,7 @@ import com.egm.stellio.search.model.*
import com.egm.stellio.search.model.AttributeInstance.TemporalProperty
import com.egm.stellio.search.model.TemporalEntityAttribute.AttributeValueType
import com.egm.stellio.search.util.*
import com.egm.stellio.shared.model.APIException
import com.egm.stellio.shared.model.ExpandedAttributeInstances
import com.egm.stellio.shared.model.NgsiLdEntity
import com.egm.stellio.shared.model.OperationNotSupportedException
import com.egm.stellio.shared.model.getScopes
import com.egm.stellio.shared.model.*
import com.egm.stellio.shared.util.INCONSISTENT_VALUES_IN_AGGREGATION_MESSAGE
import com.egm.stellio.shared.util.JsonLdUtils
import com.egm.stellio.shared.util.JsonLdUtils.NGSILD_SCOPE_PROPERTY
Expand Down Expand Up @@ -147,7 +143,7 @@ class ScopeService(
val computedOrigin = origin ?: temporalQuery.timeAt
"""
SELECT entity_id,
time_bucket('$aggrPeriodDuration', time, TIMESTAMPTZ '${computedOrigin!!}') as origin,
public.time_bucket('$aggrPeriodDuration', time, TIMESTAMPTZ '${computedOrigin!!}') as origin,
$allAggregates
"""
} else
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ class AttributeInstanceService(
val computedOrigin = origin ?: temporalQuery.timeAt
"""
SELECT temporal_entity_attribute,
time_bucket('$aggrPeriodDuration', time, TIMESTAMPTZ '${computedOrigin!!}') as origin,
public.time_bucket('$aggrPeriodDuration', time, TIMESTAMPTZ '${computedOrigin!!}') as origin,
$allAggregates
""".trimIndent()
} else
Expand Down

0 comments on commit 2a02a7c

Please sign in to comment.