(openResp *rpc.TSOpenSessionResp)
| 40 | ) |
| 41 | |
| 42 | func getTimeFactor(openResp *rpc.TSOpenSessionResp) (int32, error) { |
| 43 | if !openResp.IsSetConfiguration() { |
| 44 | return 1_000, nil |
| 45 | } |
| 46 | precision, exists := openResp.GetConfiguration()[TIME_PRECISION] |
| 47 | if !exists { |
| 48 | return 1_000, nil |
| 49 | } |
| 50 | switch precision { |
| 51 | case MILLISECOND: |
| 52 | return 1_000, nil |
| 53 | case MICROSECOND: |
| 54 | return 1_000_000, nil |
| 55 | case NANOSECOND: |
| 56 | return 1_000_000_000, nil |
| 57 | default: |
| 58 | return 0, fmt.Errorf("unknown time precision: %v", precision) |
| 59 | } |
| 60 | } |
| 61 | |
| 62 | func getTimePrecision(timeFactor int32) (string, error) { |
| 63 | switch timeFactor { |
no test coverage detected
searching dependent graphs…