[ 
https://issues.apache.org/jira/browse/PHOENIX-6118?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17309055#comment-17309055
 ] 

ASF GitHub Bot commented on PHOENIX-6118:
-----------------------------------------

yanxinyi commented on a change in pull request #878:
URL: https://github.com/apache/phoenix/pull/878#discussion_r601917412



##########
File path: 
phoenix-pherf/src/main/java/org/apache/phoenix/pherf/util/PhoenixUtil.java
##########
@@ -455,4 +473,156 @@ public String getExplainPlan(Query query, Scenario 
scenario, RulesApplier ruleAp
         }
         return buf.toString();
     }
+
+    public PreparedStatement buildStatement(RulesApplier rulesApplier, 
Scenario scenario, List<Column> columns,
+            PreparedStatement statement, SimpleDateFormat simpleDateFormat) 
throws Exception {
+
+        int count = 1;
+        for (Column column : columns) {
+            DataValue dataValue = rulesApplier.getDataForRule(scenario, 
column);
+            switch (column.getType()) {
+            case VARCHAR:
+                if (dataValue.getValue().equals("")) {
+                    statement.setNull(count, Types.VARCHAR);
+                } else {
+                    statement.setString(count, dataValue.getValue());
+                }
+                break;
+            case CHAR:
+                if (dataValue.getValue().equals("")) {
+                    statement.setNull(count, Types.CHAR);
+                } else {
+                    statement.setString(count, dataValue.getValue());
+                }
+                break;
+            case DECIMAL:
+                if (dataValue.getValue().equals("")) {
+                    statement.setNull(count, Types.DECIMAL);
+                } else {
+                    statement.setBigDecimal(count, new 
BigDecimal(dataValue.getValue()));
+                }
+                break;
+            case INTEGER:
+                if (dataValue.getValue().equals("")) {
+                    statement.setNull(count, Types.INTEGER);
+                } else {
+                    statement.setInt(count, 
Integer.parseInt(dataValue.getValue()));
+                }
+                break;
+            case UNSIGNED_LONG:
+                if (dataValue.getValue().equals("")) {
+                    statement.setNull(count, Types.OTHER);
+                } else {
+                    statement.setLong(count, 
Long.parseLong(dataValue.getValue()));
+                }
+                break;
+            case BIGINT:
+                if (dataValue.getValue().equals("")) {
+                    statement.setNull(count, Types.BIGINT);
+                } else {
+                    statement.setLong(count, 
Long.parseLong(dataValue.getValue()));
+                }
+                break;
+            case TINYINT:
+                if (dataValue.getValue().equals("")) {
+                    statement.setNull(count, Types.TINYINT);
+                } else {
+                    statement.setLong(count, 
Integer.parseInt(dataValue.getValue()));
+                }
+                break;
+            case DATE:
+                if (dataValue.getValue().equals("")) {
+                    statement.setNull(count, Types.DATE);
+                } else {
+                    Date
+                            date =

Review comment:
       can you address this in the next PR




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


> Multi Tenant Workloads using PHERF
> ----------------------------------
>
>                 Key: PHOENIX-6118
>                 URL: https://issues.apache.org/jira/browse/PHOENIX-6118
>             Project: Phoenix
>          Issue Type: Sub-task
>            Reporter: Jacob Isaac
>            Assignee: Jacob Isaac
>            Priority: Major
>          Time Spent: 3h 50m
>  Remaining Estimate: 0h
>
> Features like PHOENIX_TTL and Splittable SYSCAT need to be tested for a large 
> number of tenant views.
> In the absence of support for creating a large number of tenant views - Multi 
> leveled views dynamically and be able to query them in a generic framework, 
> the teams have to write custom logic to replay/run functional and perf 
> testing.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to