classHashMethod
final class HashMethod
implements PartitionMethod
uses Snapshot
Public API: explicitly declared with
@visibility public.[LINEAR] HASH (expression): partitioning by the value of an expression modulo the number of partitions.
Mirrors PT_part_type_def_hash and PT_sub_partition_by_hash. The expression is derived in the scope of the partitioned table. Source: https://dev.mysql.com/doc/refman/8.4/en/partitioning-hash.html.
$method = new \SqlSemantics\Platform\MySql\Statement\Partition\Method\HashMethod(false, new \SqlSemantics\Platform\MySql\Statement\Name\ColumnUse(new \SqlSemantics\Platform\MySql\Model\Statement\Identifier\Name('id')));
[$method->linear, $method->expression->name->value] // => [false, 'id']Properties§
public bool $linearpublic Scalar $expressionMethods§
public function __construct(public bool $linear, public Scalar $expression)Parameters
$linear | bool | Whether LINEAR is written |
$expression | Scalar | The partitioning expression |
public function deriveMethod(Derivation $derivation, Environment $scope): voidDerives the expression in the scope of the table.
Parameters
$derivation | Derivation | |
$scope | Environment |
Calls 1
- method-call Derivation::scalar() line 42
public function render(Output $out): voidTest cases 2§
Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.
Dedicated tests 1
HashMethodTestcalls