Skip to content

Commit

Permalink
maintains lc pg naming convention
Browse files Browse the repository at this point in the history
  • Loading branch information
net-cscience-raphael committed Aug 16, 2024
1 parent 7127034 commit 7b79384
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import java.util.*
const val RETRIEVABLE_ENTITY_NAME = "retrievable"

/** The column name of a retrievable ID. */
const val RETRIEVABLE_ID_COLUMN_NAME = "retrievableId"
const val RETRIEVABLE_ID_COLUMN_NAME = "retrievableid"

/** The column name of a retrievable ID. */
const val RETRIEVABLE_TYPE_COLUMN_NAME = "type"
Expand All @@ -25,10 +25,10 @@ const val RETRIEVABLE_TYPE_COLUMN_NAME = "type"
const val RELATIONSHIP_ENTITY_NAME = "relationships"

/** The column name of a retrievable ID. */
const val SUBJECT_ID_COLUMN_NAME = "subjectId"
const val SUBJECT_ID_COLUMN_NAME = "subjectid"

/** The column name of a retrievable ID. */
const val OBJECT_ID_COLUMN_NAME = "objectId"
const val OBJECT_ID_COLUMN_NAME = "objectid"

/** The column name of a retrievable ID. */
const val PREDICATE_COLUMN_NAME = "predicate"
Expand All @@ -37,7 +37,7 @@ const val PREDICATE_COLUMN_NAME = "predicate"
const val DESCRIPTOR_ENTITY_PREFIX = "descriptor"

/** The column name of a descriptor ID. */
const val DESCRIPTOR_ID_COLUMN_NAME = "descriptorId"
const val DESCRIPTOR_ID_COLUMN_NAME = "descriptorid"

/** The column name used to describe a distance.*/
const val DISTANCE_COLUMN_NAME = "distance"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,10 @@ class JsonlConnection(
companion object {

/** The column name of a retrievable ID. */
const val RETRIEVABLE_ID_COLUMN_NAME = "retrievableId"
const val RETRIEVABLE_ID_COLUMN_NAME = "retrievableid"

/** The column name of a descriptor ID. */
const val DESCRIPTOR_ID_COLUMN_NAME = "descriptorId"
const val DESCRIPTOR_ID_COLUMN_NAME = "descriptorid"
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ class VectorDescriptorReader(field: Schema.Field<*, VectorDescriptor<*>>, connec
*/
private fun queryProximity(query: ProximityQuery<*>): Sequence<VectorDescriptor<*>> = sequence {
val statement =
"SELECT $DESCRIPTOR_ID_COLUMN_NAME, $RETRIEVABLE_ID_COLUMN_NAME, $VECTOR_ATTRIBUTE_NAME, $VECTOR_ATTRIBUTE_NAME ${query.distance.toSql()} ? AS $DISTANCE_COLUMN_NAME FROM ${tableName} ORDER BY $DISTANCE_COLUMN_NAME ${query.order} LIMIT ${query.k}"
"SELECT $DESCRIPTOR_ID_COLUMN_NAME, $RETRIEVABLE_ID_COLUMN_NAME, $VECTOR_ATTRIBUTE_NAME, $VECTOR_ATTRIBUTE_NAME ${query.distance.toSql()} ? AS $DISTANCE_COLUMN_NAME FROM \"${tableName.lowercase()}\" ORDER BY $DISTANCE_COLUMN_NAME ${query.order} LIMIT ${query.k}"
this@VectorDescriptorReader.connection.jdbc.prepareStatement(statement).use { stmt ->
stmt.setValue(1, query.value)
stmt.executeQuery().use { result ->
Expand All @@ -117,7 +117,7 @@ class VectorDescriptorReader(field: Schema.Field<*, VectorDescriptor<*>>, connec
private fun queryAndJoinProximity(query: ProximityQuery<*>): Sequence<Retrieved> {
val descriptors = mutableListOf<Pair<VectorDescriptor<*>, Float>>()
val statement =
"SELECT $DESCRIPTOR_ID_COLUMN_NAME, $RETRIEVABLE_ID_COLUMN_NAME, $VECTOR_ATTRIBUTE_NAME, $VECTOR_ATTRIBUTE_NAME ${query.distance.toSql()} ? AS $DISTANCE_COLUMN_NAME FROM ${tableName} ORDER BY $DISTANCE_COLUMN_NAME ${query.order} LIMIT ${query.k}"
"SELECT $DESCRIPTOR_ID_COLUMN_NAME, $RETRIEVABLE_ID_COLUMN_NAME, $VECTOR_ATTRIBUTE_NAME, $VECTOR_ATTRIBUTE_NAME ${query.distance.toSql()} ? AS $DISTANCE_COLUMN_NAME FROM \"${tableName.lowercase()}\" ORDER BY $DISTANCE_COLUMN_NAME ${query.order} LIMIT ${query.k}"
this@VectorDescriptorReader.connection.jdbc.prepareStatement(statement).use { stmt ->
stmt.setValue(1, query.value)
stmt.executeQuery().use { result ->
Expand Down

0 comments on commit 7b79384

Please sign in to comment.