Remove tabs (#8508)
This commit is contained in:
parent
0e64dc84de
commit
7e7f55386d
|
|
@ -128,7 +128,7 @@ can optionally specify a custom formatter. Eg:
|
|||
|
||||
.. code-block:: python
|
||||
|
||||
def presto_query_cost_formatter(cost_estimate: List[Dict[str, float]]) -> List[Dict[str, str]]:
|
||||
def presto_query_cost_formatter(cost_estimate: List[Dict[str, float]]) -> List[Dict[str, str]]:
|
||||
"""
|
||||
Format cost estimate returned by Presto.
|
||||
|
||||
|
|
@ -137,21 +137,21 @@ can optionally specify a custom formatter. Eg:
|
|||
"""
|
||||
# Convert cost to dollars based on CPU and network cost. These coefficients are just
|
||||
# examples, they need to be estimated based on your infrastructure.
|
||||
cpu_coefficient = 2e-12
|
||||
network_coefficient = 1e-12
|
||||
cpu_coefficient = 2e-12
|
||||
network_coefficient = 1e-12
|
||||
|
||||
cost = 0
|
||||
for row in cost_estimate:
|
||||
cost += row.get("cpuCost", 0) * cpu_coefficient
|
||||
cost += row.get("networkCost", 0) * network_coefficient
|
||||
cost = 0
|
||||
for row in cost_estimate:
|
||||
cost += row.get("cpuCost", 0) * cpu_coefficient
|
||||
cost += row.get("networkCost", 0) * network_coefficient
|
||||
|
||||
return [{"Cost": f"US$ {cost:.2f}"}]
|
||||
return [{"Cost": f"US$ {cost:.2f}"}]
|
||||
|
||||
|
||||
DEFAULT_FEATURE_FLAGS = {
|
||||
"ESTIMATE_QUERY_COST": True,
|
||||
"QUERY_COST_FORMATTERS_BY_ENGINE": {"presto": presto_query_cost_formatter},
|
||||
}
|
||||
DEFAULT_FEATURE_FLAGS = {
|
||||
"ESTIMATE_QUERY_COST": True,
|
||||
"QUERY_COST_FORMATTERS_BY_ENGINE": {"presto": presto_query_cost_formatter},
|
||||
}
|
||||
|
||||
.. _ref_ctas_engine_config:
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue