6. As shown in Figure 1, in the right triangle $\triangle ABC$, it is known that $O$ is the midpoint of the hypotenuse $AB$, $CD \perp AB$ at point $D$, and $DE \perp OC$ at point $E$. If the lengths of $AD$, $DB$, and $CD$ are all rational numbers, then among the line segments $OD$, $OE$, $DE$, and $AC$, the length that is not necessarily a rational number is ( ).
(A) $OD$
(B) $O E$
(C) $D E$
(D) $A C$
6. D.

Since the lengths of $A D$, $D B$, and $C D$ are all rational numbers, we have
$$
O A=O B=O C=\frac{A D+B D}{2}
$$

which is a rational number.
Thus, $O D=O A-A D$ is a rational number.
Therefore, $O E=\frac{O D^{2}}{O C}$ and $D E=\frac{D C \cdot D O}{O C}$ are both rational numbers, while $A C=\sqrt{A D \cdot \dot{A B}}$ is not necessarily a rational number.