-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDynamoDbDynamicTest.java
More file actions
32 lines (28 loc) · 1.03 KB
/
DynamoDbDynamicTest.java
File metadata and controls
32 lines (28 loc) · 1.03 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
package com.shf.calcite.dynamodb.dynamic;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.shf.calcite.executor.ExecutorTemplate;
import lombok.extern.slf4j.Slf4j;
import org.junit.Test;
/**
* description :
*
* @author songhaifeng
* @date 2021/6/4 17:40
*/
@Slf4j
public class DynamoDbDynamicTest {
@Test
public void querySql() throws JsonProcessingException {
ObjectMapper objectMapper = new ObjectMapper();
StatementCache.CACHE.put("statement1".toUpperCase(),
objectMapper.writeValueAsString(DynamoDbSchema.Statement.builder().tableName("t_music").hashKey("artist").hashValue("lin junjie").rangeKey("title").rangeValue("caocao").build()));
String[] strArray = {
"select T1.* from dynamodb_dynamic.statement1 t1"
};
ExecutorTemplate executorTemplate = new ExecutorTemplate("/dynamic.json", true);
for (String sql : strArray) {
executorTemplate.query(sql);
}
}
}