Skip to content

Commit e1446cb

Browse files
committed
test: Updated tests for timestamp type
Signed-off-by: Anush008 <anushshetty90@gmail.com>
1 parent 03b04bb commit e1446cb

File tree

4 files changed

+41
-20
lines changed

4 files changed

+41
-20
lines changed

src/test/java/io/qdrant/spark/TestSchema.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,7 @@ public static StructType schema() {
9494
.add(new StructField("sparse_values", sparseValuesType, false, Metadata.empty()))
9595
.add(
9696
new StructField(
97-
"multi", DataTypes.createArrayType(denseVectorType), false, Metadata.empty()));
97+
"multi", DataTypes.createArrayType(denseVectorType), false, Metadata.empty()))
98+
.add(new StructField("timestamp", DataTypes.TimestampType, true, Metadata.empty()));
9899
}
99100
}

src/test/python/requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
pyspark==3.5.1
22
pytest==8.2.0
3-
qdrant-client==1.10.1
3+
qdrant-client==1.13.3
44
testcontainers==4.4.0

src/test/python/schema.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
DoubleType,
77
ArrayType,
88
FloatType,
9+
TimestampType
910
)
1011

1112
hair_schema = StructType(
@@ -103,5 +104,6 @@
103104
StructField("sparse_indices", ArrayType(IntegerType()), nullable=False),
104105
StructField("sparse_values", ArrayType(FloatType()), nullable=False),
105106
StructField("multi", ArrayType(ArrayType(FloatType())), nullable=False),
107+
StructField("timestamp", TimestampType(), nullable=False),
106108
]
107109
)

src/test/resources/users.json

Lines changed: 36 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,8 @@
119119
0.123,
120120
0.123
121121
]
122-
]
122+
],
123+
"timestamp": "2025-03-27 10:30:00"
123124
},
124125
{
125126
"id": 2,
@@ -241,7 +242,8 @@
241242
0.123,
242243
0.123
243244
]
244-
]
245+
],
246+
"timestamp": "2025-03-27 10:30:00"
245247
},
246248
{
247249
"id": 3,
@@ -363,7 +365,8 @@
363365
0.123,
364366
0.123
365367
]
366-
]
368+
],
369+
"timestamp": "2025-03-27 10:30:00"
367370
},
368371
{
369372
"id": 4,
@@ -485,7 +488,8 @@
485488
0.123,
486489
0.123
487490
]
488-
]
491+
],
492+
"timestamp": "2025-03-27 10:30:00"
489493
},
490494
{
491495
"id": 5,
@@ -607,7 +611,8 @@
607611
0.123,
608612
0.123
609613
]
610-
]
614+
],
615+
"timestamp": "2025-03-27 10:30:00"
611616
},
612617
{
613618
"id": 6,
@@ -729,7 +734,8 @@
729734
0.123,
730735
0.123
731736
]
732-
]
737+
],
738+
"timestamp": "2025-03-27 10:30:00"
733739
},
734740
{
735741
"id": 7,
@@ -851,7 +857,8 @@
851857
0.123,
852858
0.123
853859
]
854-
]
860+
],
861+
"timestamp": "2025-03-27 10:30:00"
855862
},
856863
{
857864
"id": 8,
@@ -973,7 +980,8 @@
973980
0.123,
974981
0.123
975982
]
976-
]
983+
],
984+
"timestamp": "2025-03-27 10:30:00"
977985
},
978986
{
979987
"id": 9,
@@ -1095,7 +1103,8 @@
10951103
0.123,
10961104
0.123
10971105
]
1098-
]
1106+
],
1107+
"timestamp": "2025-03-27 10:30:00"
10991108
},
11001109
{
11011110
"id": 10,
@@ -1217,7 +1226,8 @@
12171226
0.123,
12181227
0.123
12191228
]
1220-
]
1229+
],
1230+
"timestamp": "2025-03-27 10:30:00"
12211231
},
12221232
{
12231233
"id": 11,
@@ -1339,7 +1349,8 @@
13391349
0.123,
13401350
0.123
13411351
]
1342-
]
1352+
],
1353+
"timestamp": "2025-03-27 10:30:00"
13431354
},
13441355
{
13451356
"id": 12,
@@ -1460,7 +1471,8 @@
14601471
0.123,
14611472
0.123
14621473
]
1463-
]
1474+
],
1475+
"timestamp": "2025-03-27 10:30:00"
14641476
},
14651477
{
14661478
"id": 13,
@@ -1582,7 +1594,8 @@
15821594
0.123,
15831595
0.123
15841596
]
1585-
]
1597+
],
1598+
"timestamp": "2025-03-27 10:30:00"
15861599
},
15871600
{
15881601
"id": 14,
@@ -1704,7 +1717,8 @@
17041717
0.123,
17051718
0.123
17061719
]
1707-
]
1720+
],
1721+
"timestamp": "2025-03-27 10:30:00"
17081722
},
17091723
{
17101724
"id": 15,
@@ -1826,7 +1840,8 @@
18261840
0.123,
18271841
0.123
18281842
]
1829-
]
1843+
],
1844+
"timestamp": "2025-03-27 10:30:00"
18301845
},
18311846
{
18321847
"id": 16,
@@ -1948,7 +1963,8 @@
19481963
0.123,
19491964
0.123
19501965
]
1951-
]
1966+
],
1967+
"timestamp": "2025-03-27 10:30:00"
19521968
},
19531969
{
19541970
"id": 17,
@@ -2070,7 +2086,8 @@
20702086
0.123,
20712087
0.123
20722088
]
2073-
]
2089+
],
2090+
"timestamp": "2025-03-27 10:30:00"
20742091
},
20752092
{
20762093
"id": 18,
@@ -2192,6 +2209,7 @@
21922209
0.123,
21932210
0.123
21942211
]
2195-
]
2212+
],
2213+
"timestamp": "2025-03-27 10:30:00"
21962214
}
21972215
]

0 commit comments

Comments
 (0)